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

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

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

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

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

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

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

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

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

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

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

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

b.p = c
c.s = l
c.x = a
f.o = g
f.x = h
d.v = g
d.u = n
d.t = b
a.o = g
a.v = g
a.z = f
a.w = c
g.o = f
g.x = h
l.o = f
l.z = f
l.v = g
l.w = c
n.o = f
n.z = f
n.v = f
n.w = c
h.v = f
h.u = n
h.t = b
assert h.t.p.s.w.s.w.s.w.txt == "c"