class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: D = None
        self.u: H = None
        self.y: D = None
        self.x: H = None
        self.s: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: H = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: A = None
        self.q: G = None
        self.y: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: H = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: A = None
        self.q: G = None
        self.y: D = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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