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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: I = None
        self.u: F = None
        self.p: H = None
        self.x: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: A = None
        self.y: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: B = None
        self.z: C = None
        self.r: H = None
        self.w: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.s: I = None
        self.u: F = None
        self.p: H = None
        self.x: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: A = None
        self.y: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: B = None
        self.z: C = None
        self.r: H = None
        self.w: C = None
        self.txt = txt

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

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