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

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

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: F = None
        self.r: D = None
        self.v: I = None
        self.y: B = None
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: A = None
        self.v: G = None
        self.s: G = None
        self.o: I = None
        self.z: E = None
        self.t: B = None
        self.y: A = None
        self.q: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: F = None
        self.r: D = None
        self.v: I = None
        self.y: B = None
        self.u: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: A = None
        self.v: G = None
        self.s: G = None
        self.o: I = None
        self.z: E = None
        self.t: B = None
        self.y: A = None
        self.q: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

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

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