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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: A = None
        self.r: B = None
        self.w: C = None
        self.u: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: A = None
        self.r: B = None
        self.w: C = None
        self.u: C = None
        self.txt = txt

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

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

h.r = k
h.o = k
h.v = c
h.p = i
g.v = c
i.t = l
e.z = g
e.r = g
e.p = h
e.w = n
e.u = n
c.y = k
c.u = i
c.t = e
c.q = h
n.t = l
l.r = k
l.v = k
l.o = k
l.p = n
k.y = c
k.u = i
k.t = e
k.q = h
assert l.r.q.v.q.txt == "h"