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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: D = None
        self.p: E = None
        self.y: D = None
        self.t: C = None
        self.txt = txt

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

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

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

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

m.u = e
m.s = c
m.q = d
g.w = m
g.v = e
g.y = e
g.p = j
g.t = b
b.p = g
b.x = e
b.q = d
e.q = m
e.r = a
j.r = e
j.t = d
h.p = c
h.x = e
h.q = d
d.r = e
d.t = j
a.p = c
a.x = e
a.q = j
c.w = m
c.v = e
c.y = e
c.p = d
c.t = h
assert j.t.t.t.r.r.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: B = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.v: D = None
        self.p: E = None
        self.y: D = None
        self.t: C = None
        self.txt = txt

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

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

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

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

m.u = e
m.s = c
m.q = d
g.w = m
g.v = e
g.y = e
g.p = j
g.t = b
b.p = g
b.x = e
b.q = d
e.q = m
e.r = a
j.r = e
j.t = d
h.p = c
h.x = e
h.q = d
d.r = e
d.t = j
a.p = c
a.x = e
a.q = j
c.w = m
c.v = e
c.y = e
c.p = d
c.t = h
assert j.t.t.t.r.r.x.q.txt == "m"