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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: F = None
        self.y: F = None
        self.q: A = None
        self.v: F = None
        self.p: D = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: B = None
        self.x: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: C = None
        self.t: C = None
        self.y: D = None
        self.u: B = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: D = None
        self.u: B = None
        self.q: F = None
        self.r: B = None
        self.o: B = None
        self.z: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.s: F = None
        self.y: F = None
        self.q: A = None
        self.v: F = None
        self.p: D = None
        self.t: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.z: B = None
        self.x: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: C = None
        self.t: C = None
        self.y: D = None
        self.u: B = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: D = None
        self.u: B = None
        self.q: F = None
        self.r: B = None
        self.o: B = None
        self.z: A = None
        self.txt = txt

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

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