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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: E = None
        self.w: D = None
        self.t: E = None
        self.r: F = None
        self.u: D = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: E = None
        self.u: F = None
        self.w: A = None
        self.q: H = None
        self.z: E = None
        self.y: A = None
        self.p: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: G = None
        self.r: D = None
        self.u: F = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: H = None
        self.o: H = None
        self.v: A = None
        self.z: E = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: E = None
        self.p: F = None
        self.z: E = None
        self.u: E = None
        self.q: H = None
        self.x: B = None
        self.y: F = None
        self.txt = txt

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

f = A("f")
i = B("i")
g = C("g")
n = D("n")
b = E("b")
k = F("k")
l = G("l")
m = H("m")
h = A("h")

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: E = None
        self.w: D = None
        self.t: E = None
        self.r: F = None
        self.u: D = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: E = None
        self.u: F = None
        self.w: A = None
        self.q: H = None
        self.z: E = None
        self.y: A = None
        self.p: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.y: G = None
        self.r: D = None
        self.u: F = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: H = None
        self.o: H = None
        self.v: A = None
        self.z: E = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: E = None
        self.p: F = None
        self.z: E = None
        self.u: E = None
        self.q: H = None
        self.x: B = None
        self.y: F = None
        self.txt = txt

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

f = A("f")
i = B("i")
g = C("g")
n = D("n")
b = E("b")
k = F("k")
l = G("l")
m = H("m")
h = A("h")

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