class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: A = None
        self.u: E = None
        self.x: C = None
        self.txt = txt

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

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

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

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

h.u = e
h.v = l
c.s = j
c.v = n
c.u = k
c.x = e
e.y = m
a.s = k
a.y = e
a.z = e
a.q = n
k.v = j
n.u = e
n.v = m
m.s = k
m.y = e
m.z = e
m.q = h
j.u = e
j.v = m
l.s = k
l.y = e
l.z = e
l.q = h
b.s = n
b.v = h
b.u = k
b.x = e
assert e.y.y.y.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: A = None
        self.u: E = None
        self.x: C = None
        self.txt = txt

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

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

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

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

h.u = e
h.v = l
c.s = j
c.v = n
c.u = k
c.x = e
e.y = m
a.s = k
a.y = e
a.z = e
a.q = n
k.v = j
n.u = e
n.v = m
m.s = k
m.y = e
m.z = e
m.q = h
j.u = e
j.v = m
l.s = k
l.y = e
l.z = e
l.q = h
b.s = n
b.v = h
b.u = k
b.x = e
assert e.y.y.y.q.u.txt == "e"