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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: A = None
        self.q: B = None
        self.v: F = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: A = None
        self.u: B = None
        self.r: F = None
        self.s: C = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

a.x = h
a.u = h
a.r = c
h.q = c
h.o = j
i.o = c
i.p = c
i.z = k
i.q = h
i.v = f
e.t = i
e.r = f
n.o = a
n.z = a
n.u = h
n.p = h
n.r = c
n.s = i
f.v = j
m.o = a
m.z = a
m.u = h
m.p = h
m.r = f
m.s = i
k.x = h
k.u = h
k.r = f
c.v = e
j.t = i
j.r = c
assert c.v.t.v.v.r.v.t.v.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: B = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: A = None
        self.q: B = None
        self.v: F = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: A = None
        self.u: B = None
        self.r: F = None
        self.s: C = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

a.x = h
a.u = h
a.r = c
h.q = c
h.o = j
i.o = c
i.p = c
i.z = k
i.q = h
i.v = f
e.t = i
e.r = f
n.o = a
n.z = a
n.u = h
n.p = h
n.r = c
n.s = i
f.v = j
m.o = a
m.z = a
m.u = h
m.p = h
m.r = f
m.s = i
k.x = h
k.u = h
k.r = f
c.v = e
j.t = i
j.r = c
assert c.v.t.v.v.r.v.t.v.v.t.txt == "i"