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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: B = None
        self.r: A = None
        self.q: D = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: H = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: B = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: B = None
        self.r: A = None
        self.q: D = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: H = None
        self.txt = txt

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

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

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

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