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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: H = None
        self.z: H = None
        self.q: C = None
        self.s: C = None
        self.r: H = None
        self.o: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: E = None
        self.x: E = None
        self.p: C = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: H = None
        self.z: H = None
        self.q: C = None
        self.s: C = None
        self.r: H = None
        self.o: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.q: E = None
        self.x: E = None
        self.p: C = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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