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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: G = None
        self.x: G = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: E = None
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: C = None
        self.r: H = None
        self.w: B = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: A = None
        self.q: D = None
        self.y: B = None
        self.x: C = None
        self.z: B = None
        self.t: B = None
        self.v: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: E = None
        self.p: E = None
        self.q: A = None
        self.v: F = None
        self.txt = txt

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

h.p = g
h.w = m
m.p = e
m.t = k
m.x = k
m.w = d
d.v = j
d.y = b
d.w = g
i.t = e
b.w = k
e.o = j
e.r = j
e.t = d
e.w = g
e.v = k
k.w = j
k.u = h
k.q = i
k.y = g
k.z = g
k.v = g
k.x = d
k.t = m
j.t = n
j.r = i
j.v = i
j.u = k
n.w = j
n.r = b
n.p = b
n.q = h
n.v = e
g.p = e
g.t = k
g.x = k
g.w = d
assert g.t.t.x.q.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.t: G = None
        self.x: G = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: E = None
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.t: C = None
        self.r: H = None
        self.w: B = None
        self.v: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: A = None
        self.q: D = None
        self.y: B = None
        self.x: C = None
        self.z: B = None
        self.t: B = None
        self.v: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: E = None
        self.p: E = None
        self.q: A = None
        self.v: F = None
        self.txt = txt

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

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