class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: B = None
        self.y: B = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: F = None
        self.z: D = None
        self.q: C = None
        self.u: G = None
        self.p: E = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: A = None
        self.v: B = None
        self.u: F = None
        self.z: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: G = None
        self.x: E = None
        self.o: C = None
        self.w: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: F = None
        self.z: D = None
        self.q: C = None
        self.u: G = None
        self.p: E = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: A = None
        self.v: B = None
        self.u: F = None
        self.z: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: G = None
        self.x: E = None
        self.o: C = None
        self.w: E = None
        self.txt = txt

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

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

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