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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: B = None
        self.t: F = None
        self.x: C = None
        self.txt = txt

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

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

j = A("j")
f = B("f")
e = C("e")
c = D("c")
d = E("d")
i = F("i")
m = E("m")

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: B = None
        self.t: F = None
        self.x: C = None
        self.txt = txt

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

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

j = A("j")
f = B("f")
e = C("e")
c = D("c")
d = E("d")
i = F("i")
m = E("m")

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