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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: D = None
        self.q: D = None
        self.o: F = None
        self.v: H = None
        self.x: D = None
        self.y: G = None
        self.p: G = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: A = None
        self.v: G = None
        self.p: C = None
        self.u: G = None
        self.t: B = None
        self.txt = txt

b = A("b")
e = B("e")
n = C("n")
l = D("l")
g = E("g")
h = F("h")
i = G("i")
a = H("a")

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: D = None
        self.q: D = None
        self.o: F = None
        self.v: H = None
        self.x: D = None
        self.y: G = None
        self.p: G = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.o: A = None
        self.v: G = None
        self.p: C = None
        self.u: G = None
        self.t: B = None
        self.txt = txt

b = A("b")
e = B("e")
n = C("n")
l = D("l")
g = E("g")
h = F("h")
i = G("i")
a = H("a")

b.q = g
b.o = g
b.s = a
b.z = a
b.w = a
b.y = i
b.v = l
e.r = i
n.w = b
n.s = l
n.q = l
n.x = l
n.o = h
n.v = a
n.y = i
n.p = i
l.u = e
l.t = h
g.q = i
h.q = i
h.y = b
i.r = n
i.x = a
i.t = e
i.y = e
i.v = h
i.o = h
i.z = g
a.y = g
a.o = b
a.v = i
a.u = i
a.p = n
a.t = e
assert b.y.y.r.z.q.txt == "i"