class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: I = None
        self.r: C = None
        self.w: H = None
        self.z: A = None
        self.s: H = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: G = None
        self.p: H = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.s: B = None
        self.q: H = None
        self.r: B = None
        self.w: C = None
        self.t: D = None
        self.x: B = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: E = None
        self.t: B = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.s: A = None
        self.z: B = None
        self.w: F = None
        self.p: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: D = None
        self.t: F = None
        self.w: B = None
        self.u: I = None
        self.v: F = None
        self.q: B = None
        self.z: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: C = None
        self.r: H = None
        self.v: H = None
        self.z: E = None
        self.s: D = None
        self.w: B = None
        self.o: B = None
        self.txt = txt

m = A("m")
j = B("j")
d = C("d")
i = D("i")
l = E("l")
b = F("b")
h = G("h")
f = H("f")
c = I("c")
n = C("n")

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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: I = None
        self.r: C = None
        self.w: H = None
        self.z: A = None
        self.s: H = None
        self.u: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: G = None
        self.p: H = None
        self.r: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.s: B = None
        self.q: H = None
        self.r: B = None
        self.w: C = None
        self.t: D = None
        self.x: B = None
        self.v: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.y: E = None
        self.t: B = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: I = None
        self.s: A = None
        self.z: B = None
        self.w: F = None
        self.p: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: D = None
        self.t: F = None
        self.w: B = None
        self.u: I = None
        self.v: F = None
        self.q: B = None
        self.z: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: C = None
        self.r: H = None
        self.v: H = None
        self.z: E = None
        self.s: D = None
        self.w: B = None
        self.o: B = None
        self.txt = txt

m = A("m")
j = B("j")
d = C("d")
i = D("i")
l = E("l")
b = F("b")
h = G("h")
f = H("f")
c = I("c")
n = C("n")

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