class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: G = None
        self.u: E = None
        self.s: G = None
        self.w: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: E = None
        self.v: B = None
        self.u: H = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: C = None
        self.q: H = None
        self.t: H = None
        self.p: E = None
        self.y: E = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: G = None
        self.z: A = None
        self.u: H = None
        self.r: C = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: E = None
        self.v: B = None
        self.u: H = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: C = None
        self.q: H = None
        self.t: H = None
        self.p: E = None
        self.y: E = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: G = None
        self.z: A = None
        self.u: H = None
        self.r: C = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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