class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: C = None
        self.y: G = None
        self.o: D = None
        self.t: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: E = None
        self.o: C = None
        self.v: G = None
        self.u: G = None
        self.y: D = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: G = None
        self.t: H = None
        self.y: H = None
        self.x: C = None
        self.z: B = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: E = None
        self.o: C = None
        self.v: G = None
        self.u: G = None
        self.y: D = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: G = None
        self.t: H = None
        self.y: H = None
        self.x: C = None
        self.z: B = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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