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

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

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

i = A("i")
m = B("m")
h = C("h")
j = B("j")
l = C("l")
g = C("g")
e = B("e")
a = A("a")
k = A("k")

i.y = j
i.w = j
i.r = e
m.o = g
h.w = a
h.v = i
h.x = k
j.o = h
l.w = i
l.v = k
l.x = a
g.w = k
g.v = a
g.x = i
e.o = g
a.y = e
a.w = m
a.r = m
k.y = e
k.w = j
k.r = j
assert e.o.v.y.o.w.y.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: B = None
        self.r: B = None
        self.txt = txt

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

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

i = A("i")
m = B("m")
h = C("h")
j = B("j")
l = C("l")
g = C("g")
e = B("e")
a = A("a")
k = A("k")

i.y = j
i.w = j
i.r = e
m.o = g
h.w = a
h.v = i
h.x = k
j.o = h
l.w = i
l.v = k
l.x = a
g.w = k
g.v = a
g.x = i
e.o = g
a.y = e
a.w = m
a.r = m
k.y = e
k.w = j
k.r = j
assert e.o.v.y.o.w.y.o.x.txt == "i"