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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: I = None
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: H = None
        self.w: C = None
        self.q: B = None
        self.u: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: B = None
        self.u: F = None
        self.o: E = None
        self.s: D = None
        self.p: D = None
        self.z: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

h = A("h")
g = B("g")
f = C("f")
b = D("b")
m = E("m")
d = F("d")
i = G("i")
k = H("k")
a = I("a")
c = G("c")

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: I = None
        self.r: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: H = None
        self.w: C = None
        self.q: B = None
        self.u: A = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: B = None
        self.u: F = None
        self.o: E = None
        self.s: D = None
        self.p: D = None
        self.z: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

h = A("h")
g = B("g")
f = C("f")
b = D("b")
m = E("m")
d = F("d")
i = G("i")
k = H("k")
a = I("a")
c = G("c")

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