class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: F = None
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: F = None
        self.v: A = None
        self.t: E = None
        self.u: A = None
        self.q: F = None
        self.r: E = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: A = None
        self.o: E = None
        self.p: E = None
        self.t: D = None
        self.u: B = None
        self.q: C = None
        self.y: D = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.s: F = None
        self.v: A = None
        self.t: E = None
        self.u: A = None
        self.q: F = None
        self.r: E = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: A = None
        self.o: E = None
        self.p: E = None
        self.t: D = None
        self.u: B = None
        self.q: C = None
        self.y: D = None
        self.txt = txt

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

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

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

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