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

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

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

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

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

c.w = f
c.y = k
k.p = n
k.r = b
i.o = f
i.q = j
i.s = j
i.p = l
e.p = f
e.u = f
e.s = j
e.q = j
f.w = c
f.y = k
n.p = k
n.r = l
l.p = f
l.s = j
l.u = c
l.q = i
j.o = c
j.q = i
j.s = i
j.p = b
b.p = c
b.u = c
b.s = j
b.q = i
assert b.s.p.q.p.s.p.q.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: B = None
        self.txt = txt

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

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

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

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

c.w = f
c.y = k
k.p = n
k.r = b
i.o = f
i.q = j
i.s = j
i.p = l
e.p = f
e.u = f
e.s = j
e.q = j
f.w = c
f.y = k
n.p = k
n.r = l
l.p = f
l.s = j
l.u = c
l.q = i
j.o = c
j.q = i
j.s = i
j.p = b
b.p = c
b.u = c
b.s = j
b.q = i
assert b.s.p.q.p.s.p.q.o.y.txt == "k"