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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: D = None
        self.r: A = None
        self.x: G = None
        self.s: D = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: D = None
        self.r: A = None
        self.x: G = None
        self.s: D = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

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