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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: B = None
        self.p: A = None
        self.x: C = None
        self.t: A = None
        self.txt = txt

c = A("c")
a = B("a")
b = C("b")
e = D("e")
j = E("j")
m = F("m")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: B = None
        self.p: A = None
        self.x: C = None
        self.t: A = None
        self.txt = txt

c = A("c")
a = B("a")
b = C("b")
e = D("e")
j = E("j")
m = F("m")

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