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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: C = None
        self.v: E = None
        self.x: D = None
        self.s: E = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: G = None
        self.x: A = None
        self.o: H = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: B = None
        self.z: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: B = None
        self.txt = txt

f = A("f")
g = B("g")
n = C("n")
e = D("e")
b = E("b")
d = F("d")
k = G("k")
c = H("c")
i = C("i")
m = D("m")

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.u: C = None
        self.v: E = None
        self.x: D = None
        self.s: E = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.r: G = None
        self.x: A = None
        self.o: H = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.v: B = None
        self.z: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.w: B = None
        self.txt = txt

f = A("f")
g = B("g")
n = C("n")
e = D("e")
b = E("b")
d = F("d")
k = G("k")
c = H("c")
i = C("i")
m = D("m")

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