class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: F = None
        self.v: B = None
        self.t: B = None
        self.s: F = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

m = A("m")
e = B("e")
c = C("c")
k = D("k")
g = E("g")
h = F("h")
b = F("b")

m.p = h
m.z = b
m.s = b
m.y = b
m.v = e
m.t = e
e.x = k
e.z = k
e.q = k
e.p = m
c.y = b
k.s = e
k.z = e
k.q = e
k.x = g
g.w = c
h.u = e
h.p = e
b.u = e
b.p = e
assert b.u.p.s.p.p.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: F = None
        self.v: B = None
        self.t: B = None
        self.s: F = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

m = A("m")
e = B("e")
c = C("c")
k = D("k")
g = E("g")
h = F("h")
b = F("b")

m.p = h
m.z = b
m.s = b
m.y = b
m.v = e
m.t = e
e.x = k
e.z = k
e.q = k
e.p = m
c.y = b
k.s = e
k.z = e
k.q = e
k.x = g
g.w = c
h.u = e
h.p = e
b.u = e
b.p = e
assert b.u.p.s.p.p.p.u.txt == "e"