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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: H = None
        self.y: H = None
        self.t: D = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: E = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: G = None
        self.y: H = None
        self.x: C = None
        self.r: C = None
        self.p: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: G = None
        self.x: D = None
        self.r: G = None
        self.o: A = None
        self.v: D = None
        self.w: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: H = None
        self.y: H = None
        self.t: D = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: E = None
        self.o: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: G = None
        self.y: H = None
        self.x: C = None
        self.r: C = None
        self.p: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: G = None
        self.x: D = None
        self.r: G = None
        self.o: A = None
        self.v: D = None
        self.w: F = None
        self.txt = txt

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

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