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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.w: D = None
        self.q: I = None
        self.z: D = None
        self.y: D = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: F = None
        self.p: C = None
        self.s: E = None
        self.t: B = None
        self.o: F = None
        self.w: E = None
        self.y: C = None
        self.q: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: I = None
        self.w: D = None
        self.q: I = None
        self.z: D = None
        self.y: D = None
        self.o: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: F = None
        self.p: C = None
        self.s: E = None
        self.t: B = None
        self.o: F = None
        self.w: E = None
        self.y: C = None
        self.q: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: E = None
        self.txt = txt

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

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