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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: B = None
        self.q: A = None
        self.x: B = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: B = None
        self.q: A = None
        self.x: B = None
        self.r: E = None
        self.txt = txt

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

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

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

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