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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: E = None
        self.o: B = None
        self.y: H = None
        self.q: E = None
        self.v: D = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: E = None
        self.o: B = None
        self.y: H = None
        self.q: E = None
        self.v: D = None
        self.x: E = None
        self.txt = txt

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

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

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