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

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

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

i = A("i")
e = B("e")
f = C("f")
a = B("a")
l = B("l")
c = B("c")
h = B("h")
k = A("k")
m = C("m")
n = C("n")

i.o = k
e.r = i
e.v = k
f.p = e
f.v = i
f.x = i
a.r = k
a.v = i
l.r = k
l.v = k
c.r = i
c.v = i
h.r = i
h.v = k
k.o = i
m.p = h
m.v = k
m.x = i
n.p = c
n.v = k
n.x = k
assert f.v.o.o.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

i = A("i")
e = B("e")
f = C("f")
a = B("a")
l = B("l")
c = B("c")
h = B("h")
k = A("k")
m = C("m")
n = C("n")

i.o = k
e.r = i
e.v = k
f.p = e
f.v = i
f.x = i
a.r = k
a.v = i
l.r = k
l.v = k
c.r = i
c.v = i
h.r = i
h.v = k
k.o = i
m.p = h
m.v = k
m.x = i
n.p = c
n.v = k
n.x = k
assert f.v.o.o.o.o.o.o.txt == "i"