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

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

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

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

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

e.y = j
e.o = j
e.v = c
c.o = e
c.w = b
c.p = j
c.t = j
i.v = j
i.q = a
i.s = a
i.r = c
a.x = b
a.q = b
b.x = a
b.q = a
l.o = e
l.w = a
l.p = j
l.t = j
j.v = i
j.q = a
j.s = a
j.r = c
assert j.r.w.q.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: B = None
        self.o: C = None
        self.txt = txt

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

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

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

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

e.y = j
e.o = j
e.v = c
c.o = e
c.w = b
c.p = j
c.t = j
i.v = j
i.q = a
i.s = a
i.r = c
a.x = b
a.q = b
b.x = a
b.q = a
l.o = e
l.w = a
l.p = j
l.t = j
j.v = i
j.q = a
j.s = a
j.r = c
assert j.r.w.q.q.x.txt == "a"