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

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

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

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

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

j = A("j")
n = B("n")
f = C("f")
g = D("g")
k = E("k")
m = E("m")
a = A("a")
c = E("c")
h = B("h")
l = D("l")

j.s = g
j.r = g
j.w = a
j.q = a
j.u = h
n.z = h
n.q = h
n.w = c
n.u = f
n.y = g
f.x = k
g.o = h
k.r = j
k.p = c
m.r = j
m.p = k
a.s = l
a.r = l
a.w = j
a.q = j
a.u = h
c.r = a
c.p = k
h.z = n
h.q = n
h.w = c
h.u = f
h.y = g
l.o = n
assert k.r.q.q.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: A = None
        self.u: B = None
        self.r: D = None
        self.q: A = None
        self.txt = txt

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

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

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

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

j = A("j")
n = B("n")
f = C("f")
g = D("g")
k = E("k")
m = E("m")
a = A("a")
c = E("c")
h = B("h")
l = D("l")

j.s = g
j.r = g
j.w = a
j.q = a
j.u = h
n.z = h
n.q = h
n.w = c
n.u = f
n.y = g
f.x = k
g.o = h
k.r = j
k.p = c
m.r = j
m.p = k
a.s = l
a.r = l
a.w = j
a.q = j
a.u = h
c.r = a
c.p = k
h.z = n
h.q = n
h.w = c
h.u = f
h.y = g
l.o = n
assert k.r.q.q.s.o.txt == "h"