class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: C = None
        self.t: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: F = None
        self.o: D = None
        self.q: E = None
        self.x: C = None
        self.v: G = None
        self.u: C = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: D = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: D = None
        self.z: F = None
        self.q: D = None
        self.w: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: F = None
        self.o: D = None
        self.q: E = None
        self.x: C = None
        self.v: G = None
        self.u: C = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: D = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: D = None
        self.z: F = None
        self.q: D = None
        self.w: F = None
        self.txt = txt

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

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