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

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

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

i = A("i")
d = B("d")
c = C("c")
n = B("n")
g = C("g")
f = A("f")
a = A("a")
k = A("k")

i.q = d
i.o = d
i.w = c
d.s = n
d.t = n
d.o = n
c.z = f
c.s = d
c.o = g
n.s = d
n.t = d
n.o = d
g.z = f
g.s = n
g.o = c
f.q = d
f.w = g
f.o = n
a.q = n
a.w = c
a.o = d
k.q = n
k.o = n
k.w = g
assert c.o.s.s.s.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: C = None
        self.o: B = None
        self.txt = txt

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

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

i = A("i")
d = B("d")
c = C("c")
n = B("n")
g = C("g")
f = A("f")
a = A("a")
k = A("k")

i.q = d
i.o = d
i.w = c
d.s = n
d.t = n
d.o = n
c.z = f
c.s = d
c.o = g
n.s = d
n.t = d
n.o = d
g.z = f
g.s = n
g.o = c
f.q = d
f.w = g
f.o = n
a.q = n
a.w = c
a.o = d
k.q = n
k.o = n
k.w = g
assert c.o.s.s.s.t.txt == "d"