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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: A = None
        self.v: A = None
        self.y: D = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: A = None
        self.v: A = None
        self.y: D = None
        self.r: E = None
        self.txt = txt

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

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

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

k.s = b
k.r = j
k.o = j
k.x = e
k.q = g
g.s = e
g.o = e
g.y = d
g.r = l
e.z = d
e.x = j
e.v = k
e.y = h
e.r = b
d.x = b
d.p = b
d.t = l
d.r = h
b.p = k
b.s = k
b.u = j
l.z = h
l.y = h
l.x = j
l.v = k
l.r = b
j.s = b
j.r = k
j.o = k
j.x = l
j.q = g
h.x = b
h.p = b
h.t = e
h.r = d
f.s = l
f.o = l
f.y = d
f.r = e
assert h.x.u.q.r.x.txt == "j"