class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: H = None
        self.z: B = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: G = None
        self.q: E = None
        self.p: H = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: B = None
        self.s: B = None
        self.z: A = None
        self.t: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: A = None
        self.r: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: D = None
        self.s: G = None
        self.q: C = None
        self.y: F = None
        self.txt = txt

e = A("e")
f = B("f")
j = C("j")
k = D("k")
b = E("b")
l = F("l")
g = G("g")
n = H("n")
d = F("d")
h = B("h")

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: G = None
        self.q: E = None
        self.p: H = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: B = None
        self.s: B = None
        self.z: A = None
        self.t: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: A = None
        self.r: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: D = None
        self.s: G = None
        self.q: C = None
        self.y: F = None
        self.txt = txt

e = A("e")
f = B("f")
j = C("j")
k = D("k")
b = E("b")
l = F("l")
g = G("g")
n = H("n")
d = F("d")
h = B("h")

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