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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: B = None
        self.u: A = None
        self.o: F = None
        self.p: D = None
        self.w: F = None
        self.q: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: D = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: A = None
        self.r: H = None
        self.w: I = None
        self.p: F = None
        self.y: A = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: D = None
        self.x: F = None
        self.v: C = None
        self.o: B = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: G = None
        self.o: I = None
        self.x: C = None
        self.s: A = None
        self.w: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.t: B = None
        self.u: A = None
        self.o: F = None
        self.p: D = None
        self.w: F = None
        self.q: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.o: D = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: A = None
        self.r: H = None
        self.w: I = None
        self.p: F = None
        self.y: A = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.q: D = None
        self.x: F = None
        self.v: C = None
        self.o: B = None
        self.s: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: G = None
        self.o: I = None
        self.x: C = None
        self.s: A = None
        self.w: D = None
        self.txt = txt

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

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