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

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

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

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

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

h = A("h")
i = B("i")
l = C("l")
m = D("m")
e = E("e")
k = C("k")
g = D("g")
j = A("j")

h.u = j
h.o = j
h.s = k
h.r = k
h.q = l
i.q = e
i.u = m
i.r = g
i.z = h
l.q = e
m.q = l
m.y = h
m.p = i
e.o = h
e.u = m
e.r = i
e.x = l
k.q = e
g.q = l
g.y = h
g.p = i
j.u = h
j.o = h
j.s = k
j.r = k
j.q = l
assert j.q.q.r.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: C = None
        self.q: C = None
        self.o: A = None
        self.r: C = None
        self.txt = txt

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

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

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

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

h = A("h")
i = B("i")
l = C("l")
m = D("m")
e = E("e")
k = C("k")
g = D("g")
j = A("j")

h.u = j
h.o = j
h.s = k
h.r = k
h.q = l
i.q = e
i.u = m
i.r = g
i.z = h
l.q = e
m.q = l
m.y = h
m.p = i
e.o = h
e.u = m
e.r = i
e.x = l
k.q = e
g.q = l
g.y = h
g.p = i
j.u = h
j.o = h
j.s = k
j.r = k
j.q = l
assert j.q.q.r.z.txt == "h"