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

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

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

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

c.v = g
c.r = h
c.w = l
i.w = c
i.x = f
i.p = a
g.u = l
g.z = l
g.q = m
a.v = m
a.r = h
a.w = l
h.w = l
h.x = i
h.p = c
f.w = a
f.x = d
f.p = l
l.v = g
l.r = f
l.w = c
m.u = a
m.z = l
m.q = g
n.u = c
n.z = c
n.q = g
d.w = c
d.p = c
d.x = i
assert i.x.w.r.p.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: B = None
        self.w: A = None
        self.txt = txt

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

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

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

c.v = g
c.r = h
c.w = l
i.w = c
i.x = f
i.p = a
g.u = l
g.z = l
g.q = m
a.v = m
a.r = h
a.w = l
h.w = l
h.x = i
h.p = c
f.w = a
f.x = d
f.p = l
l.v = g
l.r = f
l.w = c
m.u = a
m.z = l
m.q = g
n.u = c
n.z = c
n.q = g
d.w = c
d.p = c
d.x = i
assert i.x.w.r.p.v.u.txt == "l"