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

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

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

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

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

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

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

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

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

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

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

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

n.x = g
n.t = g
n.y = c
k.s = c
k.u = c
k.p = f
m.s = c
m.w = a
m.v = a
m.p = j
g.s = n
g.v = n
g.x = j
g.p = k
g.o = a
c.p = m
j.s = c
j.w = g
j.v = g
j.p = m
a.s = n
a.x = m
a.v = f
a.p = k
a.o = g
f.x = g
f.t = g
f.y = c
assert n.y.p.p.s.p.w.txt == "a"