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

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

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

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

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

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

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

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

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

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

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

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

f.o = d
f.y = k
f.s = k
f.w = b
b.r = c
b.s = n
c.t = f
c.x = k
d.s = k
d.y = k
d.p = a
d.v = g
d.o = c
m.z = f
m.p = f
m.y = n
m.x = k
n.z = g
n.y = m
n.x = k
n.p = f
g.o = d
g.y = k
g.s = k
g.w = a
a.r = c
a.s = n
h.z = f
h.p = f
h.y = m
h.x = k
k.s = d
k.y = d
k.p = a
k.v = g
k.o = c
assert g.s.p.r.x.v.o.v.o.txt == "d"