class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: E = None
        self.p: H = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: D = None
        self.t: H = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: C = None
        self.r: B = None
        self.p: F = None
        self.z: G = None
        self.v: C = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: A = None
        self.v: H = None
        self.p: A = None
        self.w: B = None
        self.x: A = None
        self.r: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: E = None
        self.p: H = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: D = None
        self.t: H = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: C = None
        self.r: B = None
        self.p: F = None
        self.z: G = None
        self.v: C = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: A = None
        self.v: H = None
        self.p: A = None
        self.w: B = None
        self.x: A = None
        self.r: H = None
        self.txt = txt

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

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

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