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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: B = None
        self.r: D = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: B = None
        self.r: D = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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