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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: I = None
        self.s: A = None
        self.o: H = None
        self.p: A = None
        self.x: F = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: F = None
        self.v: C = None
        self.t: B = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: F = None
        self.p: G = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: B = None
        self.x: B = None
        self.q: I = None
        self.y: B = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: F = None
        self.s: B = None
        self.y: I = None
        self.t: H = None
        self.r: C = None
        self.u: A = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: G = None
        self.y: I = None
        self.s: G = None
        self.u: B = None
        self.v: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: F = None
        self.t: C = None
        self.o: H = None
        self.y: D = None
        self.u: F = None
        self.txt = txt

d = A("d")
g = B("g")
a = C("a")
l = D("l")
n = E("n")
f = F("f")
j = G("j")
h = H("h")
m = I("m")

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: I = None
        self.s: A = None
        self.o: H = None
        self.p: A = None
        self.x: F = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: I = None
        self.o: F = None
        self.v: C = None
        self.t: B = None
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: F = None
        self.p: G = None
        self.z: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: B = None
        self.x: B = None
        self.q: I = None
        self.y: B = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: F = None
        self.s: B = None
        self.y: I = None
        self.t: H = None
        self.r: C = None
        self.u: A = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.r: G = None
        self.y: I = None
        self.s: G = None
        self.u: B = None
        self.v: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: F = None
        self.t: C = None
        self.o: H = None
        self.y: D = None
        self.u: F = None
        self.txt = txt

d = A("d")
g = B("g")
a = C("a")
l = D("l")
n = E("n")
f = F("f")
j = G("j")
h = H("h")
m = I("m")

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