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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: D = None
        self.p: C = None
        self.y: D = None
        self.u: C = None
        self.txt = txt

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

n.o = c
a.y = e
a.w = d
a.q = c
a.z = c
a.s = c
b.v = c
b.w = c
b.s = n
b.x = f
b.t = e
e.w = d
e.o = b
e.v = f
f.v = a
f.z = g
f.y = g
f.p = b
f.u = b
g.w = d
g.o = b
g.v = f
c.y = g
c.w = d
c.q = a
c.z = a
c.s = a
k.o = a
d.o = c
assert d.o.y.w.o.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: D = None
        self.p: C = None
        self.y: D = None
        self.u: C = None
        self.txt = txt

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

n.o = c
a.y = e
a.w = d
a.q = c
a.z = c
a.s = c
b.v = c
b.w = c
b.s = n
b.x = f
b.t = e
e.w = d
e.o = b
e.v = f
f.v = a
f.z = g
f.y = g
f.p = b
f.u = b
g.w = d
g.o = b
g.v = f
c.y = g
c.w = d
c.q = a
c.z = a
c.s = a
k.o = a
d.o = c
assert d.o.y.w.o.y.w.txt == "d"