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

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: B = None
        self.u: B = None
        self.txt = txt

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

n = A("n")
g = B("g")
m = C("m")
c = A("c")
i = B("i")
f = B("f")
h = B("h")
j = C("j")
l = C("l")

n.t = c
n.p = i
g.q = i
g.u = i
g.x = h
m.s = j
m.x = g
c.t = n
c.p = f
i.q = h
i.u = h
i.x = f
f.q = i
f.x = i
f.u = h
h.q = i
h.x = g
h.u = g
j.s = m
j.x = f
l.s = j
l.x = f
assert c.t.t.p.u.q.x.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: A = None
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: B = None
        self.x: B = None
        self.u: B = None
        self.txt = txt

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

n = A("n")
g = B("g")
m = C("m")
c = A("c")
i = B("i")
f = B("f")
h = B("h")
j = C("j")
l = C("l")

n.t = c
n.p = i
g.q = i
g.u = i
g.x = h
m.s = j
m.x = g
c.t = n
c.p = f
i.q = h
i.u = h
i.x = f
f.q = i
f.x = i
f.u = h
h.q = i
h.x = g
h.u = g
j.s = m
j.x = f
l.s = j
l.x = f
assert c.t.t.p.u.q.x.q.txt == "i"