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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: C = None
        self.y: E = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: G = None
        self.z: G = None
        self.t: I = None
        self.w: G = None
        self.x: F = None
        self.u: F = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: C = None
        self.y: E = None
        self.v: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.p: G = None
        self.z: G = None
        self.t: I = None
        self.w: G = None
        self.x: F = None
        self.u: F = None
        self.v: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

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

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

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