class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: B = None
        self.o: E = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: A = None
        self.p: D = None
        self.u: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: A = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: A = None
        self.p: D = None
        self.u: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: A = None
        self.x: C = None
        self.txt = txt

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

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

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

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