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

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

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

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

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

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

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

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

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

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

c.w = a
c.r = a
c.s = e
c.v = i
e.x = c
i.q = c
i.z = b
i.s = j
a.o = j
a.y = j
a.u = e
a.x = e
b.q = c
b.z = i
b.s = j
n.w = a
n.r = a
n.s = e
n.v = i
j.o = a
j.y = a
j.u = e
j.x = e
assert j.x.x.r.txt == "a"