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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: B = None
        self.s: A = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: B = None
        self.x: D = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: B = None
        self.q: A = None
        self.v: G = None
        self.txt = txt

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

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

i = A("i")
f = B("f")
h = C("h")
c = D("c")
d = E("d")
m = F("m")
e = G("e")
n = C("n")
a = D("a")
g = B("g")

i.r = f
i.u = e
i.o = m
i.v = d
i.s = h
f.r = c
f.x = g
f.s = i
f.q = d
h.w = n
h.s = n
h.x = d
h.v = d
h.y = m
h.o = m
h.r = e
c.v = n
c.t = f
c.x = a
c.w = m
d.y = f
d.s = g
d.q = i
d.v = e
m.v = n
m.r = a
e.p = m
e.v = a
n.w = h
n.s = h
n.x = d
n.v = d
n.y = m
n.o = m
n.r = e
a.v = n
a.t = g
a.x = c
a.w = m
g.r = c
g.x = f
g.s = i
g.q = d
assert d.v.p.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: G = None
        self.o: F = None
        self.v: E = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: B = None
        self.s: A = None
        self.q: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: B = None
        self.x: D = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: B = None
        self.q: A = None
        self.v: G = None
        self.txt = txt

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

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

i = A("i")
f = B("f")
h = C("h")
c = D("c")
d = E("d")
m = F("m")
e = G("e")
n = C("n")
a = D("a")
g = B("g")

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