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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: H = None
        self.z: C = None
        self.r: D = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: F = None
        self.u: E = None
        self.q: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: G = None
        self.q: A = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: B = None
        self.q: A = None
        self.u: G = None
        self.s: A = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: C = None
        self.r: B = None
        self.s: C = None
        self.p: B = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: F = None
        self.o: D = None
        self.v: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: H = None
        self.z: C = None
        self.r: D = None
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: F = None
        self.u: E = None
        self.q: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: G = None
        self.q: A = None
        self.v: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: B = None
        self.q: A = None
        self.u: G = None
        self.s: A = None
        self.z: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: C = None
        self.r: B = None
        self.s: C = None
        self.p: B = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: F = None
        self.o: D = None
        self.v: H = None
        self.txt = txt

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

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