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

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

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

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

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

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

h.s = j
h.u = n
n.r = c
e.r = h
g.q = h
g.v = h
g.o = c
g.y = e
c.v = g
c.r = n
c.w = n
c.t = n
m.v = k
m.r = n
m.w = n
m.t = n
k.q = h
k.v = h
k.o = m
k.y = e
j.r = h
a.q = h
a.v = h
a.o = m
a.y = j
assert g.y.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

h.s = j
h.u = n
n.r = c
e.r = h
g.q = h
g.v = h
g.o = c
g.y = e
c.v = g
c.r = n
c.w = n
c.t = n
m.v = k
m.r = n
m.w = n
m.t = n
k.q = h
k.v = h
k.o = m
k.y = e
j.r = h
a.q = h
a.v = h
a.o = m
a.y = j
assert g.y.r.u.txt == "n"