class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: G = None
        self.x: G = None
        self.p: D = None
        self.v: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: A = None
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: I = None
        self.p: F = None
        self.o: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.u: G = None
        self.o: G = None
        self.v: A = None
        self.t: E = None
        self.q: C = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: A = None
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: I = None
        self.p: F = None
        self.o: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: I = None
        self.u: G = None
        self.o: G = None
        self.v: A = None
        self.t: E = None
        self.q: C = None
        self.txt = txt

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

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

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