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

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

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

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

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

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

k.r = b
k.t = l
k.u = l
h.q = l
h.o = n
h.y = k
h.p = i
e.r = h
e.y = h
e.w = j
l.x = h
l.q = i
l.u = i
l.p = n
n.y = b
n.x = l
b.y = n
b.x = l
c.q = l
c.o = n
c.y = k
c.p = i
i.r = h
i.y = h
i.w = j
j.r = n
j.t = l
j.u = l
assert k.t.p.x.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.t: D = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

k.r = b
k.t = l
k.u = l
h.q = l
h.o = n
h.y = k
h.p = i
e.r = h
e.y = h
e.w = j
l.x = h
l.q = i
l.u = i
l.p = n
n.y = b
n.x = l
b.y = n
b.x = l
c.q = l
c.o = n
c.y = k
c.p = i
i.r = h
i.y = h
i.w = j
j.r = n
j.t = l
j.u = l
assert k.t.p.x.x.q.txt == "l"