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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: B = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: I = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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