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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: A = None
        self.p: A = None
        self.v: F = None
        self.r: E = None
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: A = None
        self.q: B = None
        self.z: G = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: F = None
        self.o: D = None
        self.y: C = None
        self.q: E = None
        self.t: A = None
        self.txt = txt

n = A("n")
f = B("f")
d = C("d")
e = D("e")
j = E("j")
l = F("l")
i = G("i")
a = B("a")
g = E("g")
h = G("h")

n.y = j
n.q = j
n.o = g
n.w = f
n.r = e
n.u = l
f.r = d
d.q = h
d.y = n
d.p = n
d.v = l
d.r = g
d.z = g
e.o = d
j.t = n
j.w = n
j.q = f
j.z = h
j.s = d
l.s = j
i.w = e
i.o = e
i.x = l
i.y = d
i.q = j
i.t = n
a.r = d
g.t = n
g.w = n
g.q = f
g.z = i
g.s = d
h.w = e
h.o = e
h.x = l
h.y = d
h.q = j
h.t = n
assert j.q.r.q.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.q: E = None
        self.o: E = None
        self.w: B = None
        self.r: D = None
        self.u: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: A = None
        self.p: A = None
        self.v: F = None
        self.r: E = None
        self.z: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: A = None
        self.q: B = None
        self.z: G = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: F = None
        self.o: D = None
        self.y: C = None
        self.q: E = None
        self.t: A = None
        self.txt = txt

n = A("n")
f = B("f")
d = C("d")
e = D("e")
j = E("j")
l = F("l")
i = G("i")
a = B("a")
g = E("g")
h = G("h")

n.y = j
n.q = j
n.o = g
n.w = f
n.r = e
n.u = l
f.r = d
d.q = h
d.y = n
d.p = n
d.v = l
d.r = g
d.z = g
e.o = d
j.t = n
j.w = n
j.q = f
j.z = h
j.s = d
l.s = j
i.w = e
i.o = e
i.x = l
i.y = d
i.q = j
i.t = n
a.r = d
g.t = n
g.w = n
g.q = f
g.z = i
g.s = d
h.w = e
h.o = e
h.x = l
h.y = d
h.q = j
h.t = n
assert j.q.r.q.q.s.txt == "d"