class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: E = None
        self.x: F = None
        self.w: D = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: A = None
        self.r: H = None
        self.q: H = None
        self.x: C = None
        self.t: E = None
        self.v: G = None
        self.u: F = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: I = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: C = None
        self.r: E = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: E = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: A = None
        self.u: F = None
        self.v: A = None
        self.y: G = None
        self.p: G = None
        self.o: F = None
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: F = None
        self.o: B = None
        self.s: F = None
        self.txt = txt

g = A("g")
i = B("i")
c = C("c")
n = D("n")
e = E("e")
f = F("f")
m = G("m")
b = H("b")
j = I("j")
d = B("d")

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.z: A = None
        self.r: H = None
        self.q: H = None
        self.x: C = None
        self.t: E = None
        self.v: G = None
        self.u: F = None
        self.o: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: I = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: C = None
        self.r: E = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: E = None
        self.u: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: A = None
        self.u: F = None
        self.v: A = None
        self.y: G = None
        self.p: G = None
        self.o: F = None
        self.t: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: F = None
        self.o: B = None
        self.s: F = None
        self.txt = txt

g = A("g")
i = B("i")
c = C("c")
n = D("n")
e = E("e")
f = F("f")
m = G("m")
b = H("b")
j = I("j")
d = B("d")

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