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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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