class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: B = None
        self.z: G = None
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: A = None
        self.y: B = None
        self.t: F = None
        self.txt = txt

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

a.t = f
a.x = k
a.z = m
a.o = g
k.y = g
k.w = l
k.r = n
d.y = n
l.x = a
l.s = a
l.o = i
f.w = m
n.o = b
n.z = m
n.p = m
b.o = n
b.t = n
b.r = a
b.y = k
i.t = g
i.x = k
i.z = m
i.o = f
g.w = m
m.o = n
m.t = n
m.r = i
m.y = k
assert f.w.t.z.r.t.w.y.r.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: B = None
        self.z: G = None
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: A = None
        self.y: B = None
        self.t: F = None
        self.txt = txt

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

a.t = f
a.x = k
a.z = m
a.o = g
k.y = g
k.w = l
k.r = n
d.y = n
l.x = a
l.s = a
l.o = i
f.w = m
n.o = b
n.z = m
n.p = m
b.o = n
b.t = n
b.r = a
b.y = k
i.t = g
i.x = k
i.z = m
i.o = f
g.w = m
m.o = n
m.t = n
m.r = i
m.y = k
assert f.w.t.z.r.t.w.y.r.txt == "n"