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

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

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

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

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

f.y = l
f.x = c
k.t = n
k.v = f
k.p = f
i.t = e
i.p = e
i.s = n
b.y = k
b.o = c
b.s = f
b.r = i
l.t = e
l.p = e
l.s = n
c.t = n
c.v = n
c.p = n
g.t = n
g.p = n
g.v = f
n.y = l
n.x = j
j.t = n
j.v = n
j.p = f
e.y = j
e.o = c
e.s = n
e.r = l
assert b.s.y.s.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: B = None
        self.txt = txt

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

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

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

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

f.y = l
f.x = c
k.t = n
k.v = f
k.p = f
i.t = e
i.p = e
i.s = n
b.y = k
b.o = c
b.s = f
b.r = i
l.t = e
l.p = e
l.s = n
c.t = n
c.v = n
c.p = n
g.t = n
g.p = n
g.v = f
n.y = l
n.x = j
j.t = n
j.v = n
j.p = f
e.y = j
e.o = c
e.s = n
e.r = l
assert b.s.y.s.y.s.txt == "n"