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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: D = None
        self.r: C = None
        self.s: A = None
        self.x: D = None
        self.q: C = None
        self.txt = txt

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

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

e.y = m
j.u = m
d.w = e
d.z = m
d.u = m
b.z = d
b.x = c
b.o = m
m.w = f
m.o = b
m.x = b
m.r = k
m.q = k
m.s = e
c.u = j
k.w = e
k.z = m
k.u = m
f.y = m
assert j.u.s.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: D = None
        self.r: C = None
        self.s: A = None
        self.x: D = None
        self.q: C = None
        self.txt = txt

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

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

e.y = m
j.u = m
d.w = e
d.z = m
d.u = m
b.z = d
b.x = c
b.o = m
m.w = f
m.o = b
m.x = b
m.r = k
m.q = k
m.s = e
c.u = j
k.w = e
k.z = m
k.u = m
f.y = m
assert j.u.s.y.s.txt == "e"