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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: C = None
        self.w: B = None
        self.v: B = None
        self.txt = txt

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

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

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

f.x = c
l.q = j
l.p = e
l.w = k
l.v = k
e.w = j
b.o = f
b.s = j
k.q = b
k.p = c
k.w = d
k.v = l
a.x = c
c.w = j
i.x = e
d.q = b
d.p = c
d.w = k
d.v = l
j.o = i
j.s = b
assert f.x.w.s.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: C = None
        self.w: B = None
        self.v: B = None
        self.txt = txt

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

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

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

f.x = c
l.q = j
l.p = e
l.w = k
l.v = k
e.w = j
b.o = f
b.s = j
k.q = b
k.p = c
k.w = d
k.v = l
a.x = c
c.w = j
i.x = e
d.q = b
d.p = c
d.w = k
d.v = l
j.o = i
j.s = b
assert f.x.w.s.s.s.s.txt == "j"