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

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

class C:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: A = None
        self.w: C = None
        self.txt = txt

e = A("e")
j = B("j")
b = C("b")
g = C("g")
d = B("d")
i = A("i")
a = B("a")
n = C("n")

e.v = n
e.o = a
e.p = b
j.z = e
j.r = d
j.x = a
b.r = n
b.w = n
b.v = e
g.r = b
g.w = b
g.v = e
d.z = i
d.r = a
d.x = a
i.v = b
i.o = d
i.p = g
a.z = e
a.r = d
a.x = d
n.r = b
n.v = i
n.w = g
assert a.z.o.r.z.o.z.o.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: B = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: A = None
        self.w: C = None
        self.txt = txt

e = A("e")
j = B("j")
b = C("b")
g = C("g")
d = B("d")
i = A("i")
a = B("a")
n = C("n")

e.v = n
e.o = a
e.p = b
j.z = e
j.r = d
j.x = a
b.r = n
b.w = n
b.v = e
g.r = b
g.w = b
g.v = e
d.z = i
d.r = a
d.x = a
i.v = b
i.o = d
i.p = g
a.z = e
a.r = d
a.x = d
n.r = b
n.v = i
n.w = g
assert a.z.o.r.z.o.z.o.z.txt == "i"