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

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

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

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

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

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

g.r = j
g.o = j
g.v = j
g.p = i
g.q = h
i.x = m
i.o = b
i.y = b
i.u = l
i.p = h
j.x = m
j.s = i
j.y = d
j.v = g
h.x = m
h.s = l
l.r = j
l.p = i
l.t = i
l.x = d
l.s = g
m.x = h
m.s = l
d.r = j
d.o = j
d.v = j
d.p = i
d.q = h
b.r = j
b.p = i
b.t = i
b.x = g
b.s = g
assert b.r.v.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: C = None
        self.p: B = None
        self.v: C = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

g.r = j
g.o = j
g.v = j
g.p = i
g.q = h
i.x = m
i.o = b
i.y = b
i.u = l
i.p = h
j.x = m
j.s = i
j.y = d
j.v = g
h.x = m
h.s = l
l.r = j
l.p = i
l.t = i
l.x = d
l.s = g
m.x = h
m.s = l
d.r = j
d.o = j
d.v = j
d.p = i
d.q = h
b.r = j
b.p = i
b.t = i
b.x = g
b.s = g
assert b.r.v.p.p.txt == "h"