class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.x: H = None
        self.r: G = None
        self.o: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: B = None
        self.v: B = None
        self.x: H = None
        self.o: C = None
        self.u: D = None
        self.t: B = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: A = None
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: G = None
        self.w: A = None
        self.z: C = None
        self.p: B = None
        self.s: C = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: B = None
        self.v: B = None
        self.x: H = None
        self.o: C = None
        self.u: D = None
        self.t: B = None
        self.r: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: A = None
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: G = None
        self.w: A = None
        self.z: C = None
        self.p: B = None
        self.s: C = None
        self.x: F = None
        self.txt = txt

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

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