class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: D = None
        self.p: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

f.v = h
f.s = l
f.p = d
f.r = i
i.o = f
i.q = f
c.q = h
c.t = l
c.p = f
c.v = f
c.o = m
l.s = d
l.y = f
l.x = f
m.q = a
m.t = a
m.w = l
g.o = f
g.q = f
d.s = l
d.y = f
d.x = f
k.q = h
k.t = d
k.p = f
k.v = f
k.o = m
h.o = f
h.q = f
a.q = i
a.t = l
a.p = f
a.v = f
a.o = m
assert l.x.s.s.x.p.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: D = None
        self.p: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

f.v = h
f.s = l
f.p = d
f.r = i
i.o = f
i.q = f
c.q = h
c.t = l
c.p = f
c.v = f
c.o = m
l.s = d
l.y = f
l.x = f
m.q = a
m.t = a
m.w = l
g.o = f
g.q = f
d.s = l
d.y = f
d.x = f
k.q = h
k.t = d
k.p = f
k.v = f
k.o = m
h.o = f
h.q = f
a.q = i
a.t = l
a.p = f
a.v = f
a.o = m
assert l.x.s.s.x.p.y.v.txt == "h"