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

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

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

i = A("i")
a = B("a")
f = C("f")
d = C("d")
h = C("h")
k = B("k")
c = C("c")
g = B("g")
m = C("m")
j = B("j")

i.p = d
a.x = i
a.r = i
a.t = j
f.w = h
f.v = k
f.s = i
d.w = c
d.v = j
d.s = i
h.w = f
h.v = j
h.s = i
k.x = i
k.r = i
k.t = j
c.w = h
c.v = j
c.s = i
g.x = i
g.r = i
g.t = k
m.w = d
m.v = a
m.s = i
j.x = i
j.r = i
j.t = g
assert f.v.t.r.p.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

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

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

i = A("i")
a = B("a")
f = C("f")
d = C("d")
h = C("h")
k = B("k")
c = C("c")
g = B("g")
m = C("m")
j = B("j")

i.p = d
a.x = i
a.r = i
a.t = j
f.w = h
f.v = k
f.s = i
d.w = c
d.v = j
d.s = i
h.w = f
h.v = j
h.s = i
k.x = i
k.r = i
k.t = j
c.w = h
c.v = j
c.s = i
g.x = i
g.r = i
g.t = k
m.w = d
m.v = a
m.s = i
j.x = i
j.r = i
j.t = g
assert f.v.t.r.p.s.p.txt == "d"