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

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: E = None
        self.y: B = None
        self.txt = txt

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

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

a = A("a")
e = B("e")
l = C("l")
f = D("f")
k = E("k")
b = F("b")

a.z = k
a.r = f
e.s = l
e.q = f
l.o = a
l.p = e
f.r = k
f.p = k
f.y = e
k.w = l
k.s = f
k.o = a
b.w = k
b.u = e
b.r = e
b.q = a
b.z = l
assert e.q.r.o.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: E = None
        self.y: B = None
        self.txt = txt

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

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

a = A("a")
e = B("e")
l = C("l")
f = D("f")
k = E("k")
b = F("b")

a.z = k
a.r = f
e.s = l
e.q = f
l.o = a
l.p = e
f.r = k
f.p = k
f.y = e
k.w = l
k.s = f
k.o = a
b.w = k
b.u = e
b.r = e
b.q = a
b.z = l
assert e.q.r.o.r.y.txt == "e"