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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: F = None
        self.x: F = None
        self.q: G = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: E = None
        self.r: A = None
        self.y: G = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: A = None
        self.z: C = None
        self.u: B = None
        self.p: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: F = None
        self.x: F = None
        self.q: G = None
        self.s: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: E = None
        self.r: A = None
        self.y: G = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: A = None
        self.z: C = None
        self.u: B = None
        self.p: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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