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

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

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

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

e = A("e")
a = B("a")
c = C("c")
h = D("h")
j = C("j")
b = A("b")
g = B("g")
k = A("k")
i = B("i")
l = D("l")

e.x = l
e.q = l
e.v = b
e.o = j
a.v = j
a.o = c
c.y = e
h.v = c
h.z = c
h.s = j
h.q = l
j.y = b
b.x = h
b.v = e
b.q = l
b.o = c
g.v = j
g.o = c
k.x = h
k.v = e
k.q = l
k.o = c
i.v = c
i.o = j
l.v = j
l.s = j
l.z = c
l.q = h
assert i.o.y.q.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: A = None
        self.q: D = None
        self.o: C = None
        self.txt = txt

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

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

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

e = A("e")
a = B("a")
c = C("c")
h = D("h")
j = C("j")
b = A("b")
g = B("g")
k = A("k")
i = B("i")
l = D("l")

e.x = l
e.q = l
e.v = b
e.o = j
a.v = j
a.o = c
c.y = e
h.v = c
h.z = c
h.s = j
h.q = l
j.y = b
b.x = h
b.v = e
b.q = l
b.o = c
g.v = j
g.o = c
k.x = h
k.v = e
k.q = l
k.o = c
i.v = c
i.o = j
l.v = j
l.s = j
l.z = c
l.q = h
assert i.o.y.q.s.y.txt == "b"