class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: B = None
        self.t: F = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: A = None
        self.w: F = None
        self.q: D = None
        self.t: E = None
        self.z: I = None
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: C = None
        self.w: C = None
        self.q: A = None
        self.v: D = None
        self.x: A = None
        self.txt = txt

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

i.s = g
i.w = d
i.t = m
d.q = a
d.w = a
d.t = b
d.z = g
d.o = j
h.q = i
g.r = i
g.p = j
j.v = c
j.r = i
m.p = h
m.q = a
a.r = b
b.o = n
b.w = n
b.p = i
b.q = g
b.t = j
b.x = j
b.z = c
c.p = h
c.z = h
c.w = h
c.q = i
c.x = i
c.v = g
n.p = h
n.q = a
assert j.r.w.z.r.t.q.r.o.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: B = None
        self.t: F = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: A = None
        self.w: F = None
        self.q: D = None
        self.t: E = None
        self.z: I = None
        self.x: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: C = None
        self.w: C = None
        self.q: A = None
        self.v: D = None
        self.x: A = None
        self.txt = txt

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

i.s = g
i.w = d
i.t = m
d.q = a
d.w = a
d.t = b
d.z = g
d.o = j
h.q = i
g.r = i
g.p = j
j.v = c
j.r = i
m.p = h
m.q = a
a.r = b
b.o = n
b.w = n
b.p = i
b.q = g
b.t = j
b.x = j
b.z = c
c.p = h
c.z = h
c.w = h
c.q = i
c.x = i
c.v = g
n.p = h
n.q = a
assert j.r.w.z.r.t.q.r.o.p.q.txt == "i"