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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: H = None
        self.r: H = None
        self.u: C = None
        self.v: A = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: H = None
        self.w: G = None
        self.x: B = None
        self.v: B = None
        self.p: E = None
        self.s: H = None
        self.o: B = None
        self.txt = txt

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

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

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

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

g = A("g")
e = B("e")
j = C("j")
m = D("m")
d = E("d")
l = F("l")
b = G("b")
i = H("i")

g.p = j
g.v = j
g.q = d
g.o = d
g.t = d
g.r = d
g.z = l
e.y = l
e.t = i
e.r = i
e.u = j
e.z = j
e.v = g
j.w = g
j.z = d
j.t = l
j.q = b
m.u = e
m.x = e
m.v = e
m.o = e
m.q = i
m.s = i
m.w = b
m.p = d
d.x = i
d.p = i
d.r = e
d.u = j
l.v = i
l.x = i
l.z = g
l.y = b
l.o = j
b.v = g
b.q = j
b.w = e
b.p = d
b.t = m
i.t = j
i.s = e
i.v = b
i.q = d
assert i.q.r.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: E = None
        self.o: E = None
        self.v: C = None
        self.t: E = None
        self.r: E = None
        self.z: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: H = None
        self.r: H = None
        self.u: C = None
        self.v: A = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: H = None
        self.w: G = None
        self.x: B = None
        self.v: B = None
        self.p: E = None
        self.s: H = None
        self.o: B = None
        self.txt = txt

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

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

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

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

g = A("g")
e = B("e")
j = C("j")
m = D("m")
d = E("d")
l = F("l")
b = G("b")
i = H("i")

g.p = j
g.v = j
g.q = d
g.o = d
g.t = d
g.r = d
g.z = l
e.y = l
e.t = i
e.r = i
e.u = j
e.z = j
e.v = g
j.w = g
j.z = d
j.t = l
j.q = b
m.u = e
m.x = e
m.v = e
m.o = e
m.q = i
m.s = i
m.w = b
m.p = d
d.x = i
d.p = i
d.r = e
d.u = j
l.v = i
l.x = i
l.z = g
l.y = b
l.o = j
b.v = g
b.q = j
b.w = e
b.p = d
b.t = m
i.t = j
i.s = e
i.v = b
i.q = d
assert i.q.r.v.r.txt == "d"