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

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

b = A("b")
i = B("i")
e = C("e")
k = A("k")
f = C("f")
c = B("c")
h = C("h")
l = C("l")
g = C("g")

b.y = k
b.s = k
b.z = e
i.v = c
e.x = g
e.p = g
e.q = c
k.y = b
k.s = b
k.z = g
f.x = l
f.p = g
f.q = c
c.v = i
h.x = g
h.p = f
h.q = i
l.x = e
l.p = g
l.q = i
g.x = l
g.p = f
g.q = c
assert b.y.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: C = None
        self.s: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

b = A("b")
i = B("i")
e = C("e")
k = A("k")
f = C("f")
c = B("c")
h = C("h")
l = C("l")
g = C("g")

b.y = k
b.s = k
b.z = e
i.v = c
e.x = g
e.p = g
e.q = c
k.y = b
k.s = b
k.z = g
f.x = l
f.p = g
f.q = c
c.v = i
h.x = g
h.p = f
h.q = i
l.x = e
l.p = g
l.q = i
g.x = l
g.p = f
g.q = c
assert b.y.s.z.txt == "e"