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

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

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

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

e = A("e")
g = B("g")
i = C("i")
k = D("k")
l = A("l")
c = D("c")
n = B("n")

e.w = i
e.v = i
e.u = l
g.s = k
g.u = i
g.p = n
i.y = c
k.y = c
k.o = e
l.w = i
l.v = i
l.u = e
c.y = k
c.o = e
n.s = c
n.u = i
n.p = g
assert c.y.y.y.o.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: A = None
        self.v: C = None
        self.txt = txt

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

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

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

e = A("e")
g = B("g")
i = C("i")
k = D("k")
l = A("l")
c = D("c")
n = B("n")

e.w = i
e.v = i
e.u = l
g.s = k
g.u = i
g.p = n
i.y = c
k.y = c
k.o = e
l.w = i
l.v = i
l.u = e
c.y = k
c.o = e
n.s = c
n.u = i
n.p = g
assert c.y.y.y.o.v.y.txt == "c"