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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: A = None
        self.s: B = None
        self.o: C = None
        self.x: B = None
        self.txt = txt

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

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

h = A("h")
j = B("j")
g = C("g")
i = D("i")
d = E("d")
m = C("m")
a = C("a")
l = C("l")

h.r = i
h.q = d
h.y = d
j.y = h
j.x = i
g.z = h
g.v = h
g.s = j
g.x = j
g.o = m
i.w = h
i.x = l
i.t = d
d.v = i
d.q = m
d.u = l
m.z = h
m.v = h
m.s = j
m.x = j
m.o = a
a.z = h
a.v = h
a.s = j
a.x = j
a.o = l
l.z = h
l.v = h
l.s = j
l.x = j
l.o = m
assert h.q.u.o.o.o.x.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: E = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: A = None
        self.s: B = None
        self.o: C = None
        self.x: B = None
        self.txt = txt

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

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

h = A("h")
j = B("j")
g = C("g")
i = D("i")
d = E("d")
m = C("m")
a = C("a")
l = C("l")

h.r = i
h.q = d
h.y = d
j.y = h
j.x = i
g.z = h
g.v = h
g.s = j
g.x = j
g.o = m
i.w = h
i.x = l
i.t = d
d.v = i
d.q = m
d.u = l
m.z = h
m.v = h
m.s = j
m.x = j
m.o = a
a.z = h
a.v = h
a.s = j
a.x = j
a.o = l
l.z = h
l.v = h
l.s = j
l.x = j
l.o = m
assert h.q.u.o.o.o.x.y.r.txt == "i"