class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: D = None
        self.q: E = None
        self.y: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: A = None
        self.o: E = None
        self.q: B = None
        self.txt = txt

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

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

n.w = e
n.y = e
n.z = j
n.q = c
b.w = n
b.v = g
b.r = l
l.s = n
l.z = n
l.r = b
g.p = k
g.r = a
g.o = c
g.q = b
k.s = l
k.o = e
c.s = l
c.o = e
e.p = k
e.r = n
e.o = c
e.q = b
a.w = e
a.z = g
a.y = g
a.q = c
j.p = k
j.r = n
j.o = c
j.q = b
assert j.o.o.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: D = None
        self.q: E = None
        self.y: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: A = None
        self.o: E = None
        self.q: B = None
        self.txt = txt

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

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

n.w = e
n.y = e
n.z = j
n.q = c
b.w = n
b.v = g
b.r = l
l.s = n
l.z = n
l.r = b
g.p = k
g.r = a
g.o = c
g.q = b
k.s = l
k.o = e
c.s = l
c.o = e
e.p = k
e.r = n
e.o = c
e.q = b
a.w = e
a.z = g
a.y = g
a.q = c
j.p = k
j.r = n
j.o = c
j.q = b
assert j.o.o.r.w.txt == "e"