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

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

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

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

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

d = A("d")
b = B("b")
g = C("g")
h = D("h")
k = E("k")
l = D("l")
i = E("i")
c = A("c")
j = C("j")

d.q = b
d.t = b
d.y = g
b.r = g
b.v = l
b.s = h
g.x = k
g.q = k
g.y = b
g.o = b
h.s = i
h.o = d
h.r = l
h.z = l
k.q = h
k.z = h
k.w = i
l.s = k
l.o = c
l.r = h
l.z = h
i.q = h
i.z = l
i.w = k
c.q = b
c.t = b
c.y = g
j.x = k
j.q = k
j.y = b
j.o = b
assert l.r.s.z.o.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: C = None
        self.t: B = None
        self.txt = txt

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

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

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

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

d = A("d")
b = B("b")
g = C("g")
h = D("h")
k = E("k")
l = D("l")
i = E("i")
c = A("c")
j = C("j")

d.q = b
d.t = b
d.y = g
b.r = g
b.v = l
b.s = h
g.x = k
g.q = k
g.y = b
g.o = b
h.s = i
h.o = d
h.r = l
h.z = l
k.q = h
k.z = h
k.w = i
l.s = k
l.o = c
l.r = h
l.z = h
i.q = h
i.z = l
i.w = k
c.q = b
c.t = b
c.y = g
j.x = k
j.q = k
j.y = b
j.o = b
assert l.r.s.z.o.t.s.txt == "h"