class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: A = None
        self.txt = txt

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

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

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

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

f = A("f")
n = B("n")
i = C("i")
j = D("j")
g = E("g")
b = A("b")
a = B("a")
l = B("l")
h = C("h")
d = E("d")

f.w = b
f.y = b
n.y = g
i.y = l
i.p = a
i.v = d
i.x = d
j.v = h
j.x = a
g.v = i
g.x = j
g.w = j
g.s = d
g.o = d
b.w = f
b.y = f
a.y = g
l.y = g
h.y = l
h.p = l
h.v = d
h.x = d
d.v = i
d.x = j
d.w = j
d.s = g
d.o = g
assert j.x.y.v.x.w.v.p.y.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: A = None
        self.txt = txt

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

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

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

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

f = A("f")
n = B("n")
i = C("i")
j = D("j")
g = E("g")
b = A("b")
a = B("a")
l = B("l")
h = C("h")
d = E("d")

f.w = b
f.y = b
n.y = g
i.y = l
i.p = a
i.v = d
i.x = d
j.v = h
j.x = a
g.v = i
g.x = j
g.w = j
g.s = d
g.o = d
b.w = f
b.y = f
a.y = g
l.y = g
h.y = l
h.p = l
h.v = d
h.x = d
d.v = i
d.x = j
d.w = j
d.s = g
d.o = g
assert j.x.y.v.x.w.v.p.y.x.v.txt == "h"