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

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

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: C = None
        self.p: D = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: C = None
        self.s: C = None
        self.o: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: C = None
        self.p: D = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: C = None
        self.s: C = None
        self.o: B = None
        self.txt = txt

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

j.v = h
j.p = m
j.s = g
a.s = d
a.w = k
k.o = c
k.x = c
k.p = l
k.t = h
l.s = a
l.r = h
l.p = j
g.p = m
g.u = c
g.s = k
g.o = a
m.p = g
m.u = c
m.s = c
m.o = a
c.o = k
c.x = k
c.p = h
c.t = h
d.v = l
d.p = m
d.s = m
h.s = a
h.r = l
h.p = d
assert c.t.s.w.t.r.p.v.p.txt == "d"