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

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

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

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

f.y = l
f.r = h
f.o = b
l.v = h
g.v = l
g.p = h
g.w = c
h.v = c
h.p = g
h.w = l
a.v = h
i.v = a
i.p = h
i.w = c
c.v = g
n.y = c
n.r = i
n.o = f
b.y = c
b.r = h
b.o = f
assert i.p.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: C = None
        self.o: A = None
        self.txt = txt

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

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

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

f.y = l
f.r = h
f.o = b
l.v = h
g.v = l
g.p = h
g.w = c
h.v = c
h.p = g
h.w = l
a.v = h
i.v = a
i.p = h
i.w = c
c.v = g
n.y = c
n.r = i
n.o = f
b.y = c
b.r = h
b.o = f
assert i.p.w.v.txt == "h"