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

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

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

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

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

f = A("f")
g = B("g")
c = C("c")
a = D("a")
e = E("e")

f.r = a
f.q = e
f.t = c
g.o = c
c.t = f
c.w = f
c.s = f
a.x = e
a.o = f
a.u = g
e.p = c
e.y = c
e.u = c
e.v = a
e.r = a
assert e.u.t.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: E = None
        self.t: C = None
        self.txt = txt

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

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

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

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

f = A("f")
g = B("g")
c = C("c")
a = D("a")
e = E("e")

f.r = a
f.q = e
f.t = c
g.o = c
c.t = f
c.w = f
c.s = f
a.x = e
a.o = f
a.u = g
e.p = c
e.y = c
e.u = c
e.v = a
e.r = a
assert e.u.t.t.s.txt == "f"