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

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

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

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

f = A("f")
i = B("i")
m = C("m")
a = D("a")
n = D("n")
e = A("e")
h = C("h")
g = A("g")
j = D("j")
b = C("b")

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

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

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

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

f = A("f")
i = B("i")
m = C("m")
a = D("a")
n = D("n")
e = A("e")
h = C("h")
g = A("g")
j = D("j")
b = C("b")

f.t = b
f.q = i
i.o = j
i.t = j
m.q = a
m.x = i
m.v = e
a.y = j
a.o = m
n.y = j
n.o = b
e.t = h
e.q = i
h.q = a
h.x = i
h.v = e
g.t = m
g.q = i
j.y = n
j.o = b
b.q = j
b.x = i
b.v = f
assert a.y.y.y.o.q.o.v.t.x.txt == "i"