class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.q: D = None
        self.o: G = None
        self.y: E = None
        self.t: I = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: I = None
        self.q: D = None
        self.o: G = None
        self.y: E = None
        self.t: I = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.w: D = None
        self.txt = txt

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

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