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

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

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

j = A("j")
d = B("d")
e = C("e")
b = A("b")
i = A("i")
m = B("m")
a = B("a")
h = C("h")

j.w = d
j.x = h
j.v = h
d.p = h
d.x = a
e.y = h
e.q = h
e.o = j
b.w = m
b.x = e
b.v = e
i.w = a
i.x = e
i.v = h
m.p = h
m.x = a
a.p = h
a.x = m
h.y = e
h.q = e
h.o = j
assert j.w.x.p.o.x.y.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: C = None
        self.v: C = None
        self.txt = txt

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

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

j = A("j")
d = B("d")
e = C("e")
b = A("b")
i = A("i")
m = B("m")
a = B("a")
h = C("h")

j.w = d
j.x = h
j.v = h
d.p = h
d.x = a
e.y = h
e.q = h
e.o = j
b.w = m
b.x = e
b.v = e
i.w = a
i.x = e
i.v = h
m.p = h
m.x = a
a.p = h
a.x = m
h.y = e
h.q = e
h.o = j
assert j.w.x.p.o.x.y.o.v.txt == "h"