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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: B = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: B = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: E = None
        self.s: E = None
        self.t: B = None
        self.x: A = None
        self.txt = txt

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

l.v = a
l.o = n
a.w = c
a.x = k
a.v = k
f.x = c
f.t = a
f.z = n
h.w = k
h.x = a
h.s = a
c.q = n
c.o = n
c.s = n
c.t = a
c.x = l
n.q = c
n.o = c
n.s = c
n.t = a
n.x = l
j.x = n
j.t = a
j.z = c
k.w = h
k.x = a
k.s = a
i.x = n
i.z = n
i.t = a
assert n.s.x.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: B = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: B = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: E = None
        self.s: E = None
        self.t: B = None
        self.x: A = None
        self.txt = txt

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

l.v = a
l.o = n
a.w = c
a.x = k
a.v = k
f.x = c
f.t = a
f.z = n
h.w = k
h.x = a
h.s = a
c.q = n
c.o = n
c.s = n
c.t = a
c.x = l
n.q = c
n.o = c
n.s = c
n.t = a
n.x = l
j.x = n
j.t = a
j.z = c
k.w = h
k.x = a
k.s = a
i.x = n
i.z = n
i.t = a
assert n.s.x.o.x.txt == "l"