class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: D = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: D = None
        self.o: E = None
        self.t: I = None
        self.w: I = None
        self.p: F = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: F = None
        self.s: B = None
        self.t: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: H = None
        self.s: C = None
        self.p: G = None
        self.x: D = None
        self.z: C = None
        self.y: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: D = None
        self.o: E = None
        self.t: I = None
        self.w: I = None
        self.p: F = None
        self.v: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: F = None
        self.s: B = None
        self.t: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.v: H = None
        self.s: C = None
        self.p: G = None
        self.x: D = None
        self.z: C = None
        self.y: B = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.y: A = None
        self.txt = txt

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

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