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

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

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

g = A("g")
n = B("n")
i = C("i")
l = B("l")
e = C("e")
m = A("m")
b = C("b")
k = C("k")

g.s = m
g.r = l
n.r = m
n.p = m
n.o = l
i.y = m
i.v = m
l.r = g
l.p = g
l.o = n
e.y = m
e.v = m
m.s = g
m.r = l
b.y = m
b.v = m
k.y = m
k.v = m
assert e.v.r.p.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: B = None
        self.txt = txt

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

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

g = A("g")
n = B("n")
i = C("i")
l = B("l")
e = C("e")
m = A("m")
b = C("b")
k = C("k")

g.s = m
g.r = l
n.r = m
n.p = m
n.o = l
i.y = m
i.v = m
l.r = g
l.p = g
l.o = n
e.y = m
e.v = m
m.s = g
m.r = l
b.y = m
b.v = m
k.y = m
k.v = m
assert e.v.r.p.r.o.txt == "n"