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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: D = None
        self.r: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: C = None
        self.s: F = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: B = None
        self.v: G = None
        self.t: G = None
        self.w: I = None
        self.z: E = None
        self.s: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: G = None
        self.y: H = None
        self.o: F = None
        self.x: G = None
        self.r: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: D = None
        self.r: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.t: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: C = None
        self.s: F = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.y: B = None
        self.v: G = None
        self.t: G = None
        self.w: I = None
        self.z: E = None
        self.s: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: G = None
        self.y: H = None
        self.o: F = None
        self.x: G = None
        self.r: A = None
        self.txt = txt

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

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