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

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

class C:
    def __init__(self, txt: str):
        self.p: I = None
        self.r: H = None
        self.s: E = None
        self.u: F = None
        self.o: H = None
        self.x: B = None
        self.y: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: I = None
        self.r: H = None
        self.s: E = None
        self.u: F = None
        self.o: H = None
        self.x: B = None
        self.y: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: B = None
        self.txt = txt

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

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

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