class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: F = None
        self.u: H = None
        self.p: G = None
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: D = None
        self.z: C = None
        self.y: D = None
        self.x: G = None
        self.v: H = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: B = None
        self.s: H = None
        self.y: H = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: B = None
        self.y: C = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: D = None
        self.r: H = None
        self.q: H = None
        self.p: A = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: G = None
        self.q: D = None
        self.w: H = None
        self.u: E = None
        self.t: H = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

c = A("c")
a = B("a")
m = C("m")
n = D("n")
l = E("l")
b = F("b")
e = G("e")
f = H("f")
g = H("g")

c.t = m
c.s = b
c.u = g
c.y = g
c.p = e
a.u = c
a.t = n
a.y = n
a.z = m
a.x = e
a.v = g
a.r = f
m.z = n
m.r = a
m.x = a
m.s = g
m.y = f
n.u = a
n.o = a
n.y = m
n.x = l
l.z = n
l.t = n
l.r = f
l.q = f
l.p = c
l.u = c
b.o = c
b.y = e
b.q = n
b.w = g
b.u = l
b.t = f
b.r = m
e.q = c
f.x = g
g.x = f
assert c.u.x.x.x.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: F = None
        self.u: H = None
        self.p: G = None
        self.y: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: D = None
        self.z: C = None
        self.y: D = None
        self.x: G = None
        self.v: H = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: B = None
        self.s: H = None
        self.y: H = None
        self.x: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: B = None
        self.y: C = None
        self.x: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: D = None
        self.r: H = None
        self.q: H = None
        self.p: A = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: G = None
        self.q: D = None
        self.w: H = None
        self.u: E = None
        self.t: H = None
        self.r: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.txt = txt

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

c = A("c")
a = B("a")
m = C("m")
n = D("n")
l = E("l")
b = F("b")
e = G("e")
f = H("f")
g = H("g")

c.t = m
c.s = b
c.u = g
c.y = g
c.p = e
a.u = c
a.t = n
a.y = n
a.z = m
a.x = e
a.v = g
a.r = f
m.z = n
m.r = a
m.x = a
m.s = g
m.y = f
n.u = a
n.o = a
n.y = m
n.x = l
l.z = n
l.t = n
l.r = f
l.q = f
l.p = c
l.u = c
b.o = c
b.y = e
b.q = n
b.w = g
b.u = l
b.t = f
b.r = m
e.q = c
f.x = g
g.x = f
assert c.u.x.x.x.x.x.x.txt == "g"