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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: A = None
        self.y: D = None
        self.u: A = None
        self.txt = txt

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

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

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

j = A("j")
n = B("n")
a = C("a")
c = D("c")
k = E("k")
e = C("e")
g = C("g")
l = A("l")

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: A = None
        self.y: D = None
        self.u: A = None
        self.txt = txt

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

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

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

j = A("j")
n = B("n")
a = C("a")
c = D("c")
k = E("k")
e = C("e")
g = C("g")
l = A("l")

j.p = n
j.v = n
j.y = l
j.x = c
j.s = k
n.r = c
n.y = c
n.x = j
n.u = j
a.y = e
a.w = c
a.x = k
c.o = l
c.p = k
c.w = k
k.y = e
e.y = g
e.w = c
e.x = k
g.y = e
g.w = c
g.x = k
l.p = n
l.v = n
l.y = j
l.x = c
l.s = k
assert k.y.x.y.x.y.w.txt == "c"