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

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

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

l = A("l")
a = B("a")
h = C("h")
k = B("k")
g = A("g")
f = A("f")
n = C("n")
c = A("c")
e = C("e")
m = C("m")

l.x = a
l.s = g
a.y = c
a.q = k
h.q = n
h.w = k
k.y = g
k.q = a
g.x = k
g.s = f
f.x = a
f.s = l
n.q = h
n.w = k
c.x = k
c.s = g
e.q = n
e.w = k
m.q = n
m.w = a
assert a.q.y.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: A = None
        self.txt = txt

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

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

l = A("l")
a = B("a")
h = C("h")
k = B("k")
g = A("g")
f = A("f")
n = C("n")
c = A("c")
e = C("e")
m = C("m")

l.x = a
l.s = g
a.y = c
a.q = k
h.q = n
h.w = k
k.y = g
k.q = a
g.x = k
g.s = f
f.x = a
f.s = l
n.q = h
n.w = k
c.x = k
c.s = g
e.q = n
e.w = k
m.q = n
m.w = a
assert a.q.y.s.s.txt == "l"