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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: B = None
        self.txt = txt

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

h.t = l
b.v = c
b.o = k
b.y = k
b.q = k
b.w = n
c.o = h
c.u = h
c.v = l
c.q = g
l.w = h
l.o = h
k.w = h
k.q = n
n.v = c
n.o = k
n.y = k
n.q = k
n.w = b
g.v = c
g.o = k
g.y = k
g.q = k
g.w = b
assert k.w.t.o.t.w.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: B = None
        self.txt = txt

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

h.t = l
b.v = c
b.o = k
b.y = k
b.q = k
b.w = n
c.o = h
c.u = h
c.v = l
c.q = g
l.w = h
l.o = h
k.w = h
k.q = n
n.v = c
n.o = k
n.y = k
n.q = k
n.w = b
g.v = c
g.o = k
g.y = k
g.q = k
g.w = b
assert k.w.t.o.t.w.t.o.txt == "h"