class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: C = None
        self.p: F = None
        self.q: C = None
        self.x: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: B = None
        self.u: H = None
        self.txt = txt

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

m = A("m")
h = B("h")
d = C("d")
l = D("l")
c = E("c")
j = F("j")
g = G("g")
k = H("k")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: B = None
        self.u: H = None
        self.txt = txt

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

m = A("m")
h = B("h")
d = C("d")
l = D("l")
c = E("c")
j = F("j")
g = G("g")
k = H("k")

m.t = k
m.o = d
m.q = d
m.p = j
m.x = h
h.x = g
h.s = m
h.t = m
h.q = m
h.w = k
h.r = l
d.s = l
d.q = l
d.w = j
d.o = m
d.t = c
l.u = m
l.x = c
l.w = j
l.v = d
c.p = m
c.z = m
c.q = m
c.y = m
c.s = l
c.v = l
c.r = j
j.u = h
j.s = d
g.s = h
g.o = h
g.u = k
k.p = l
k.v = m
k.x = m
assert m.o.w.u.x.o.r.w.u.txt == "h"