class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: B = None
        self.z: F = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

b = A("b")
d = B("d")
i = C("i")
j = D("j")
c = E("c")
m = F("m")

b.u = m
b.z = m
b.w = d
b.y = c
d.w = m
i.z = c
i.w = j
j.w = m
j.r = i
c.r = m
c.u = m
c.o = i
c.t = j
m.o = j
m.p = j
m.w = d
m.u = c
m.x = b
m.y = i
assert j.w.u.u.y.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: B = None
        self.z: F = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

b = A("b")
d = B("d")
i = C("i")
j = D("j")
c = E("c")
m = F("m")

b.u = m
b.z = m
b.w = d
b.y = c
d.w = m
i.z = c
i.w = j
j.w = m
j.r = i
c.r = m
c.u = m
c.o = i
c.t = j
m.o = j
m.p = j
m.w = d
m.u = c
m.x = b
m.y = i
assert j.w.u.u.y.z.txt == "c"