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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: D = None
        self.s: B = None
        self.u: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: A = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: D = None
        self.s: B = None
        self.u: C = None
        self.txt = txt

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

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