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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: I = None
        self.w: G = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: H = None
        self.o: I = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: I = None
        self.t: I = None
        self.r: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: B = None
        self.t: A = None
        self.y: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: A = None
        self.o: B = None
        self.v: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.x: I = None
        self.w: G = None
        self.t: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: H = None
        self.o: I = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: I = None
        self.t: I = None
        self.r: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: B = None
        self.t: A = None
        self.y: E = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: A = None
        self.o: B = None
        self.v: F = None
        self.txt = txt

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

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