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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: F = None
        self.v: F = None
        self.z: C = None
        self.w: G = None
        self.t: C = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: G = None
        self.v: C = None
        self.p: A = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: B = None
        self.w: G = None
        self.u: E = None
        self.q: F = None
        self.txt = txt

b = A("b")
j = B("j")
d = C("d")
i = D("i")
a = E("a")
f = F("f")
n = G("n")
e = F("e")
k = B("k")
h = G("h")

b.w = f
b.s = i
b.y = i
b.t = n
b.q = n
b.z = a
j.t = k
d.v = k
d.p = e
i.y = d
i.u = d
i.t = d
i.z = f
i.o = b
i.q = b
i.r = h
a.r = j
a.o = j
a.y = f
a.v = e
a.z = d
a.t = d
a.w = h
f.w = j
f.t = n
f.v = d
f.p = b
f.z = h
n.r = h
n.w = h
n.s = j
n.u = a
n.q = e
e.w = k
e.t = h
e.v = d
e.p = b
e.z = n
k.t = j
h.r = n
h.w = n
h.s = k
h.u = a
h.q = e
assert i.q.t.s.t.t.t.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: D = None
        self.t: G = None
        self.z: E = None
        self.y: D = None
        self.q: G = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: F = None
        self.v: F = None
        self.z: C = None
        self.w: G = None
        self.t: C = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: G = None
        self.v: C = None
        self.p: A = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: G = None
        self.s: B = None
        self.w: G = None
        self.u: E = None
        self.q: F = None
        self.txt = txt

b = A("b")
j = B("j")
d = C("d")
i = D("i")
a = E("a")
f = F("f")
n = G("n")
e = F("e")
k = B("k")
h = G("h")

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