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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: G = None
        self.r: C = None
        self.x: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: C = None
        self.w: F = None
        self.r: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: G = None
        self.r: C = None
        self.x: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: C = None
        self.w: F = None
        self.r: C = None
        self.txt = txt

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

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