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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: A = None
        self.u: A = None
        self.p: E = None
        self.txt = txt

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

h.o = e
h.x = n
h.y = d
k.v = e
k.q = c
l.s = e
f.u = l
f.y = c
n.q = d
n.x = e
n.u = h
n.p = a
e.o = h
e.x = a
e.y = d
a.q = l
a.x = h
a.u = h
a.p = n
d.s = h
i.u = d
i.y = k
c.v = h
c.q = k
assert i.y.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: E = None
        self.y: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: A = None
        self.u: A = None
        self.p: E = None
        self.txt = txt

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

h.o = e
h.x = n
h.y = d
k.v = e
k.q = c
l.s = e
f.u = l
f.y = c
n.q = d
n.x = e
n.u = h
n.p = a
e.o = h
e.x = a
e.y = d
a.q = l
a.x = h
a.u = h
a.p = n
d.s = h
i.u = d
i.y = k
c.v = h
c.q = k
assert i.y.v.o.txt == "h"