class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: B = None
        self.w: B = None
        self.x: A = None
        self.v: E = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.s: B = None
        self.w: B = None
        self.x: A = None
        self.v: E = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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