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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.s: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: C = None
        self.z: G = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.v: I = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: C = None
        self.w: A = None
        self.o: C = None
        self.q: H = None
        self.x: I = None
        self.t: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.x: J = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: I = None
        self.s: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: C = None
        self.z: G = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: I = None
        self.v: I = None
        self.u: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: C = None
        self.w: A = None
        self.o: C = None
        self.q: H = None
        self.x: I = None
        self.t: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: I = None
        self.x: J = None
        self.txt = txt

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

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

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

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