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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: A = None
        self.t: D = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: A = None
        self.t: D = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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