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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: C = None
        self.r: A = None
        self.txt = txt

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

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

e.y = d
e.o = i
e.r = i
l.w = i
l.y = d
l.r = e
d.x = e
d.w = c
d.v = k
c.w = e
c.y = d
c.r = i
k.w = i
k.y = d
k.r = e
n.w = e
n.y = d
n.r = i
i.y = d
i.o = e
i.r = e
assert k.w.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: A = None
        self.r: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: C = None
        self.r: A = None
        self.txt = txt

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

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

e.y = d
e.o = i
e.r = i
l.w = i
l.y = d
l.r = e
d.x = e
d.w = c
d.v = k
c.w = e
c.y = d
c.r = i
k.w = i
k.y = d
k.r = e
n.w = e
n.y = d
n.r = i
i.y = d
i.o = e
i.r = e
assert k.w.y.x.txt == "e"