class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: B = None
        self.w: D = None
        self.u: D = None
        self.t: D = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: E = None
        self.t: D = None
        self.y: E = None
        self.z: D = None
        self.p: D = None
        self.txt = txt

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

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

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

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

f = A("f")
m = B("m")
e = C("e")
g = D("g")
c = E("c")
n = F("n")
d = A("d")

f.q = e
f.r = e
f.p = m
f.w = g
f.u = g
f.t = g
m.x = c
m.u = c
m.y = c
m.t = g
m.z = g
m.p = g
e.u = f
e.p = n
e.w = m
g.r = e
c.r = m
n.x = g
n.t = e
n.y = c
n.r = c
n.v = m
d.q = e
d.r = e
d.p = m
d.w = g
d.u = g
d.t = g
assert c.r.p.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: B = None
        self.w: D = None
        self.u: D = None
        self.t: D = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: E = None
        self.t: D = None
        self.y: E = None
        self.z: D = None
        self.p: D = None
        self.txt = txt

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

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

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

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

f = A("f")
m = B("m")
e = C("e")
g = D("g")
c = E("c")
n = F("n")
d = A("d")

f.q = e
f.r = e
f.p = m
f.w = g
f.u = g
f.t = g
m.x = c
m.u = c
m.y = c
m.t = g
m.z = g
m.p = g
e.u = f
e.p = n
e.w = m
g.r = e
c.r = m
n.x = g
n.t = e
n.y = c
n.r = c
n.v = m
d.q = e
d.r = e
d.p = m
d.w = g
d.u = g
d.t = g
assert c.r.p.r.u.txt == "f"