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

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

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

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

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

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

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

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

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

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

e.x = m
e.p = a
e.t = l
j.q = n
j.y = a
j.v = a
j.x = i
m.r = a
g.z = l
g.x = l
g.v = m
g.o = i
h.x = l
h.t = l
h.p = j
i.z = m
i.x = m
i.v = l
i.o = g
l.r = a
a.q = n
a.y = j
a.v = j
a.x = g
n.x = m
n.t = m
n.p = j
assert i.z.r.x.v.r.txt == "a"