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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: H = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: H = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: H = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: H = None
        self.w: A = None
        self.txt = txt

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

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