class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: C = None
        self.p: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: A = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: C = None
        self.p: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: A = None
        self.v: D = None
        self.txt = txt

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

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

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