class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: F = None
        self.u: C = None
        self.t: C = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: D = None
        self.p: C = None
        self.r: F = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: B = None
        self.z: A = None
        self.u: F = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: B = None
        self.r: C = None
        self.y: C = None
        self.p: C = None
        self.txt = txt

l = A("l")
m = B("m")
h = C("h")
c = D("c")
a = E("a")
g = F("g")
d = C("d")
b = C("b")

l.t = g
m.v = a
m.x = a
m.o = g
m.u = h
m.t = d
h.s = c
h.z = c
h.p = d
h.r = g
h.x = a
c.z = g
a.o = l
a.z = l
a.t = m
a.q = m
a.u = g
g.x = l
g.z = m
g.r = h
g.y = h
g.p = d
d.s = c
d.z = c
d.p = h
d.r = g
d.x = a
b.s = c
b.z = c
b.p = d
b.r = g
b.x = a
assert h.p.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: F = None
        self.u: C = None
        self.t: C = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: D = None
        self.p: C = None
        self.r: F = None
        self.x: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: B = None
        self.z: A = None
        self.u: F = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: B = None
        self.r: C = None
        self.y: C = None
        self.p: C = None
        self.txt = txt

l = A("l")
m = B("m")
h = C("h")
c = D("c")
a = E("a")
g = F("g")
d = C("d")
b = C("b")

l.t = g
m.v = a
m.x = a
m.o = g
m.u = h
m.t = d
h.s = c
h.z = c
h.p = d
h.r = g
h.x = a
c.z = g
a.o = l
a.z = l
a.t = m
a.q = m
a.u = g
g.x = l
g.z = m
g.r = h
g.y = h
g.p = d
d.s = c
d.z = c
d.p = h
d.r = g
d.x = a
b.s = c
b.z = c
b.p = d
b.r = g
b.x = a
assert h.p.x.t.txt == "m"