class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: E = None
        self.x: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

f = A("f")
m = B("m")
j = C("j")
k = D("k")
a = E("a")
e = F("e")
n = G("n")
l = D("l")
b = D("b")
c = E("c")

f.y = m
m.o = a
m.s = c
m.x = e
j.s = m
j.w = f
k.w = n
k.o = b
k.u = j
a.p = f
e.o = f
e.p = c
e.q = c
e.w = a
n.x = c
n.o = k
n.u = f
n.y = m
n.s = j
l.w = n
l.o = b
l.u = j
b.w = n
b.o = l
b.u = j
c.p = f
assert m.s.p.y.o.p.y.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: E = None
        self.x: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

f = A("f")
m = B("m")
j = C("j")
k = D("k")
a = E("a")
e = F("e")
n = G("n")
l = D("l")
b = D("b")
c = E("c")

f.y = m
m.o = a
m.s = c
m.x = e
j.s = m
j.w = f
k.w = n
k.o = b
k.u = j
a.p = f
e.o = f
e.p = c
e.q = c
e.w = a
n.x = c
n.o = k
n.u = f
n.y = m
n.s = j
l.w = n
l.o = b
l.u = j
b.w = n
b.o = l
b.u = j
c.p = f
assert m.s.p.y.o.p.y.s.p.txt == "f"