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

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

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

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

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

h = A("h")
g = B("g")
n = C("n")
m = D("m")
a = E("a")
b = A("b")
i = E("i")

h.t = a
h.p = b
h.y = b
h.v = i
g.v = n
g.w = n
g.q = m
n.t = h
n.s = g
n.y = b
m.v = b
m.w = b
a.o = i
b.t = a
b.p = h
b.y = h
b.v = i
i.o = a
assert b.t.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: A = None
        self.y: A = None
        self.v: E = None
        self.txt = txt

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

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

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

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

h = A("h")
g = B("g")
n = C("n")
m = D("m")
a = E("a")
b = A("b")
i = E("i")

h.t = a
h.p = b
h.y = b
h.v = i
g.v = n
g.w = n
g.q = m
n.t = h
n.s = g
n.y = b
m.v = b
m.w = b
a.o = i
b.t = a
b.p = h
b.y = h
b.v = i
i.o = a
assert b.t.o.o.o.o.txt == "a"