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

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

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: F = None
        self.v: B = None
        self.s: B = None
        self.q: F = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: C = None
        self.o: B = None
        self.p: F = None
        self.t: B = None
        self.y: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: H = None
        self.p: F = None
        self.v: B = None
        self.s: B = None
        self.q: F = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: H = None
        self.x: C = None
        self.o: B = None
        self.p: F = None
        self.t: B = None
        self.y: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

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