class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

e.x = j
e.t = j
j.v = c
j.r = m
g.u = j
g.v = e
m.o = c
m.t = g
m.q = g
b.w = j
b.q = j
b.u = j
b.s = m
b.o = g
c.w = j
c.q = j
c.u = j
c.s = m
c.o = g
assert b.s.o.q.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

e.x = j
e.t = j
j.v = c
j.r = m
g.u = j
g.v = e
m.o = c
m.t = g
m.q = g
b.w = j
b.q = j
b.u = j
b.s = m
b.o = g
c.w = j
c.q = j
c.u = j
c.s = m
c.o = g
assert b.s.o.q.r.o.txt == "c"