class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: E = None
        self.q: F = None
        self.u: D = None
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: E = None
        self.o: I = None
        self.r: I = None
        self.w: H = None
        self.t: F = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: F = None
        self.t: H = None
        self.o: H = None
        self.p: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.w: G = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: A = None
        self.v: I = None
        self.p: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: G = None
        self.p: I = None
        self.t: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: E = None
        self.o: I = None
        self.r: I = None
        self.w: H = None
        self.t: F = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: F = None
        self.t: H = None
        self.o: H = None
        self.p: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: I = None
        self.w: G = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.s: A = None
        self.v: I = None
        self.p: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: G = None
        self.p: I = None
        self.t: E = None
        self.txt = txt

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

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