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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: B = None
        self.r: I = None
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: D = None
        self.o: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.w: B = None
        self.r: I = None
        self.x: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: C = None
        self.v: D = None
        self.o: D = None
        self.txt = txt

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

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

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