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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: C = None
        self.txt = txt

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

i.u = b
i.x = b
i.w = b
i.r = f
e.w = i
e.o = i
e.t = c
j.z = c
b.y = i
b.o = i
b.t = i
b.r = j
f.z = b
f.p = b
f.s = b
c.o = b
c.t = j
assert i.r.p.r.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: D = None
        self.w: D = None
        self.r: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: C = None
        self.txt = txt

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

i.u = b
i.x = b
i.w = b
i.r = f
e.w = i
e.o = i
e.t = c
j.z = c
b.y = i
b.o = i
b.t = i
b.r = j
f.z = b
f.p = b
f.s = b
c.o = b
c.t = j
assert i.r.p.r.txt == "j"