class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: C = None
        self.s: C = None
        self.w: A = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: C = None
        self.s: C = None
        self.x: D = None
        self.q: A = None
        self.txt = txt

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

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

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

l = A("l")
b = B("b")
a = C("a")
n = D("n")
f = E("f")
k = B("k")
e = E("e")
m = C("m")
g = A("g")

l.v = f
l.o = a
l.s = a
l.u = a
l.w = g
b.p = m
b.t = a
b.s = a
b.x = n
b.q = g
a.v = e
n.s = m
n.v = m
n.q = f
f.q = k
k.p = m
k.t = m
k.s = m
k.x = n
k.q = g
e.q = k
m.v = f
g.v = e
g.o = a
g.s = a
g.w = l
g.u = m
assert g.w.s.v.q.p.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: C = None
        self.s: C = None
        self.w: A = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: C = None
        self.s: C = None
        self.x: D = None
        self.q: A = None
        self.txt = txt

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

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

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

l = A("l")
b = B("b")
a = C("a")
n = D("n")
f = E("f")
k = B("k")
e = E("e")
m = C("m")
g = A("g")

l.v = f
l.o = a
l.s = a
l.u = a
l.w = g
b.p = m
b.t = a
b.s = a
b.x = n
b.q = g
a.v = e
n.s = m
n.v = m
n.q = f
f.q = k
k.p = m
k.t = m
k.s = m
k.x = n
k.q = g
e.q = k
m.v = f
g.v = e
g.o = a
g.s = a
g.w = l
g.u = m
assert g.w.s.v.q.p.v.q.txt == "k"