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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: H = None
        self.o: H = None
        self.t: E = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: A = None
        self.o: I = None
        self.y: F = None
        self.t: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: A = None
        self.z: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: H = None
        self.o: H = None
        self.t: E = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: H = None
        self.r: A = None
        self.o: I = None
        self.y: F = None
        self.t: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: A = None
        self.z: B = None
        self.txt = txt

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

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