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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: A = None
        self.x: G = None
        self.q: C = None
        self.r: G = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: B = None
        self.v: A = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: C = None
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: D = None
        self.u: G = None
        self.q: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.o: A = None
        self.x: G = None
        self.q: C = None
        self.r: G = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: B = None
        self.v: A = None
        self.x: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: C = None
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.s: D = None
        self.u: G = None
        self.q: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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