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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: B = None
        self.t: F = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: B = None
        self.t: F = None
        self.q: A = None
        self.txt = txt

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

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

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