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

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: E = None
        self.p: D = None
        self.txt = txt

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

b.v = n
b.q = g
d.o = g
d.t = i
d.y = l
d.p = l
j.w = n
j.z = n
j.v = d
j.o = b
h.u = g
n.y = j
n.u = g
n.p = h
a.w = g
a.z = g
a.v = d
a.o = b
g.y = j
g.u = n
g.p = h
l.o = n
l.t = d
l.p = d
l.y = i
i.o = n
i.t = d
i.y = d
i.p = d
assert h.u.y.o.v.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.u: E = None
        self.p: D = None
        self.txt = txt

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

b.v = n
b.q = g
d.o = g
d.t = i
d.y = l
d.p = l
j.w = n
j.z = n
j.v = d
j.o = b
h.u = g
n.y = j
n.u = g
n.p = h
a.w = g
a.z = g
a.v = d
a.o = b
g.y = j
g.u = n
g.p = h
l.o = n
l.t = d
l.p = d
l.y = i
i.o = n
i.t = d
i.y = d
i.p = d
assert h.u.y.o.v.p.u.txt == "g"