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

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

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

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

e = A("e")
j = B("j")
l = C("l")
f = D("f")
a = C("a")
d = B("d")
n = A("n")
b = A("b")
i = D("i")

e.s = f
j.u = a
j.v = d
l.u = a
l.w = j
l.o = i
f.r = l
f.t = e
f.p = e
a.u = l
a.w = d
a.o = i
d.u = a
d.v = j
n.s = f
b.s = i
i.r = l
i.t = e
i.p = e
assert i.p.s.t.s.t.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

e = A("e")
j = B("j")
l = C("l")
f = D("f")
a = C("a")
d = B("d")
n = A("n")
b = A("b")
i = D("i")

e.s = f
j.u = a
j.v = d
l.u = a
l.w = j
l.o = i
f.r = l
f.t = e
f.p = e
a.u = l
a.w = d
a.o = i
d.u = a
d.v = j
n.s = f
b.s = i
i.r = l
i.t = e
i.p = e
assert i.p.s.t.s.t.s.txt == "f"