class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: E = None
        self.r: D = None
        self.q: D = None
        self.x: C = None
        self.w: E = None
        self.s: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: F = None
        self.q: A = None
        self.w: H = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: A = None
        self.s: E = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: F = None
        self.q: A = None
        self.w: H = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.u: A = None
        self.s: E = None
        self.y: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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