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

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

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

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

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

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

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

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

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

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

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