class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: D = None
        self.t: E = None
        self.v: C = None
        self.p: E = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: B = None
        self.u: A = None
        self.o: C = None
        self.v: B = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

h = A("h")
l = B("l")
k = C("k")
m = D("m")
i = E("i")
c = F("c")
n = F("n")
j = C("j")
f = C("f")

h.o = j
l.x = m
k.y = l
k.r = m
k.t = i
k.p = i
k.v = f
k.x = c
m.w = l
m.y = l
m.v = l
m.u = h
m.o = j
m.q = n
i.y = l
c.u = l
n.u = l
j.y = l
j.r = m
j.t = i
j.p = i
j.v = f
j.x = c
f.y = l
f.r = m
f.t = i
f.p = i
f.v = k
f.x = c
assert j.r.o.y.x.u.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: D = None
        self.t: E = None
        self.v: C = None
        self.p: E = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: B = None
        self.u: A = None
        self.o: C = None
        self.v: B = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

h = A("h")
l = B("l")
k = C("k")
m = D("m")
i = E("i")
c = F("c")
n = F("n")
j = C("j")
f = C("f")

h.o = j
l.x = m
k.y = l
k.r = m
k.t = i
k.p = i
k.v = f
k.x = c
m.w = l
m.y = l
m.v = l
m.u = h
m.o = j
m.q = n
i.y = l
c.u = l
n.u = l
j.y = l
j.r = m
j.t = i
j.p = i
j.v = f
j.x = c
f.y = l
f.r = m
f.t = i
f.p = i
f.v = k
f.x = c
assert j.r.o.y.x.u.o.v.txt == "f"