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

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

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

f = A("f")
j = B("j")
e = C("e")
d = A("d")
g = C("g")
i = C("i")
m = A("m")
h = C("h")

f.t = j
f.y = m
j.t = m
j.v = i
e.p = j
e.q = j
e.o = j
d.t = j
d.y = f
g.p = j
g.q = j
g.o = j
i.p = j
i.q = j
i.o = j
m.t = j
m.y = d
h.p = j
h.q = j
h.o = j
assert e.o.v.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: A = None
        self.txt = txt

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

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

f = A("f")
j = B("j")
e = C("e")
d = A("d")
g = C("g")
i = C("i")
m = A("m")
h = C("h")

f.t = j
f.y = m
j.t = m
j.v = i
e.p = j
e.q = j
e.o = j
d.t = j
d.y = f
g.p = j
g.q = j
g.o = j
i.p = j
i.q = j
i.o = j
m.t = j
m.y = d
h.p = j
h.q = j
h.o = j
assert e.o.v.q.v.txt == "i"