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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: D = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: A = None
        self.w: H = None
        self.u: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: D = None
        self.p: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: A = None
        self.w: H = None
        self.u: B = None
        self.txt = txt

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

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

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